SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

I want to try C++ in SharpDevelop, but CPPNET binding can't compile

Last post 09-26-2007 12:14 PM by DanielGrunwald. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 09-01-2006 8:08 PM

    • rui.long.e
    • Not Ranked
    • Joined on 09-01-2006
    • Shanghai, P.R.China.
    • Posts 2

    I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    Hello, 

     
    I find the source codes for C++ .net binding in the Addin folder(contained in SharpDevelop source code), but there is no project file like others ( ILAsm, Boo). Then I create a project file for it, add the src, templates, and reference. But this project can't compile.

    there is a line : 'using ICSharpCode.SharpDevelop.Internal.Project;'

    compiler can't find the Project in ICSharpCode.SharpDevelop.Internal.

    total errors 148, all of them are 'can't find something' error.

    I just  copy one of them here: "The type or namespace name 'Project' does not exist in the namespace 'ICSharpCode.SharpDevelop.Internal' (are you missing an assembly reference?)"

    I only add ICSharpCode.Core.dll and ICSharpCode.SharpDevelop.dll to reference. Is it enough? 

    any one can help on this? Thanks in advance. 

     

    Kevin
    Filed under:
  • 09-01-2006 8:18 PM In reply to

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    There is no C++ binding for SharpDevelop 2.0.

    The source code there is years old and was never updated. It does not work with the new project file format. It does not work with the new build system (MSBuild). There's nothing in it that's still useful; it's faster to rewrite it than to fix it.

    Daniel Grunwald
  • 09-01-2006 8:42 PM In reply to

    • rui.long.e
    • Not Ranked
    • Joined on 09-01-2006
    • Shanghai, P.R.China.
    • Posts 2

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    Thank you.

    I just study SharpDevelop for a few days.

    I want to study C#,  I still need C++.

    Why does SharpDevelop give up supporting the C++ binding?

    I come here to study SharpDevelop, because I want a IDE for myself, my toolchain is g++(cynwin).

    It seem that I have to learn how to write the C++ addin, then begin my work.

    Do you have any advise to me?

    Thanks a lot. 

     

    Kevin
  • 09-01-2006 8:55 PM In reply to

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    Someone requested information about writing a C++ binding some time ago. I'm pasting my mail:

    To: Tim Brooks
    From: Daniel Grunwald
    Date:  Sun, 28 May 2006 20:32:20 +0200
    >No one else is working on C++ bindings. The SharpDevelop 1.1 C++
    >binding was very primitive: you could enter code and compile it;
    >there was no class browser support etc.
    >SharpDevelop 2.0 is using MSBuild for compiling, so the old C++
    >binding is no help for that. That means you have to start at zero.
    >What complicates this even more is that Visual Studio uses some
    >trick to compile C++ projects using MSBuild - their project files
    >are not MSBuild files. That means you probably have to make a new
    >project format for SharpDevelop 2.0 C++ projects.
    >
    >I just responded to a request for help writing an IronPython
    >binding. The same instructions apply to any new language binding, so
    >I'll paste a copy for you:
    >
    >Sorry, there currently is no documentation about backend bindings
    >now.
    >The first step is creating a project type and the compiler binding.
    >For the compiler, you need to write a MSBuild task for the compiler.
    >Then you'll need a targets file that can be included by MSBuild and
    >calls that task.
    >In the SharpDevelop source code, take a look at
    >SharpDevelop\src\Libraries\ICSharpCode.Build.Tasks\Project\ILAsm.cs
    >and SharpDevelop.Build.MSIL.targets
    >However it is possible that the Visual Studio IronPython integration
    >already comes with the MSBuild task and targets file; then you can
    >just use that.
    >
    >Now the real start: Create a new SharpDevelop AddIn project.
    >The video at
    >http://laputa.sharpdevelop.net/WritingASharpDevelopAddInTutorialVideo.aspx
    >should help you understand the basics. Don't forget to look at the
    >SharpDevelop\doc\technotes directory (in the SharpDevelop source
    >code download).
    >Then you should look at the ILAsmBinding source code (it's the
    >simplest backend binding possible). When you look at
    >ILAsmBinding.addin, you'll see the most important things to provide:
    >1. FileFilter entry. Just copy it from ILAsmBinding and adjust to
    >your needs.
    >2. Templates: The XML entry tells SharpDevelop to look for a
    >"Templates" directory inside the directory containing your AddIn
    >assembly. Just create such a directory in the project browser and
    >add a .xpt file to it, then set "Copy to output directory" for the
    >.xpt file to "Always".
    >For writing the .xpt project template, just use the one from
    >ILAsmBinding and adjust it to your needs. The important part is the
    ><LanguageName> property: this must match the language name used in
    >the next step.
    >3. Language Binding. Use the <LanguageBinding> codon to register
    >your language binding with SharpDevelop. Try to use the file
    >extension and GUID from the Visual Studio IronPython AddIn; or
    >create your own GUID (Tools > Insert New GUID) and use a new file
    >extension.
    >For writing the LanguageBinding class: just adapt the
    >ILAsmLanguageBinding to your needs. The "single file compilation" is
    >not supported by SharpDevelop 2.0, it'll always use MSBuild. The
    >important methods left are LoadProject and CreateProject. Both have
    >to return a new instance of your project class. The project class
    >can be really simple (again, look at ILAsmProject) if you inherit
    >from MSBuildProject. Just set the language name; don't forget to
    >call base.Create(info) in the new project constructor /
    >SetupProject(fileName) in the load project constructor. In the
    >constructor creating a new project, you have to use "imports.Add()"
    >to add a reference to your MSBuild target file. If you put your
    >targets file in your AddIn's directory, you can create your own
    >MSBuild property like this:
    >       static bool initialized = false;
    >       static void Init()
    >       {
    >           if (!initialized) {
    >               initialized = true;
    >              
    >MSBuildEngine.CompileTaskNames.Add("nameOfMyMSBuildCompilerTask");
    >// makes SharpDevelop show the "Compiling ProjectName..."-line when
    >compiling your projects
    >              
    >MSBuildEngine.MSBuildProperties.Add("MyLanguageBinPath",
    >Path.GetDirectoryName(typeof(MyProject).Assembly.Location));
    >           }
    >       }
    >Make sure you call Init() in both constructors of your project
    >class.
    >
    >4. ILAsmBinding.addin also contains the project options section. The
    >dialog panels reference panels in the main SharpDevelop code that
    >can be used for all (.NET) languages. If you use them, you need a
    >"<Import assembly = ":ICSharpCode.SharpDevelop"/>" entry in your
    ><Runtime> section.
    >
    >5. Syntax mode for the text editor should be compiled as embedded
    >resource and can be loaded using the <SyntaxMode> codon. You don't
    >need this at the beginning.
    >
    >This is everything you need for very simple integration of a
    >language.
    >The next step after this is providing a parser for the language.
    >That is a bit complicated (especially if you cannot use the parser
    >from the IronPython compiler and have to write your own), but it
    >will enable folding and the class browser (both the "Classes" pad
    >and the combo boxes above the code editor).
    >
    >If you run into any problems, you can ask me for help; or better,
    >ask in the forums: http://community.sharpdevelop.net/forums/
    >
    >Daniel Grunwald

     

    I did not saw any code he wrote, but here is the last mail from him:

    I have indeed looked at it but truhfully haven't gotten too far.  What I have successfully done is to re-add the basic binding(?) and CPP project options.  (This was there before)  You can now, in my version, select basic windows, console or generic CPP project and it will use a template to create them.  Also regonizes and creates .h and .cpp files.

    What needs to be done is to create/manage the cpp compile options via the options component/interface and then compile based on those.  As you may know, MSBUILD (the compiler that both VS and #Dev use, does not recognize nor compile cpp project.  When it encounters a cpp project it simply hands it off to the VCBUILD compiler which is itself just an alias for cl.exe.....The cl compiler only ships with VC (probably express as well) so there is a hard dependency there. 

    What has to be solved is:

    1) What the structure of the vcproj file needs to be and hand to manage it via the options tabs within #Dev

    2)  How to hand off the project to MSBUILD via the build bindings.  This is where I've bogged down as I don't completely understand how the various #Dev and .Net build bindings work together in order to create the proper binding.   

    3) Also then need to understand what the allowable options are for VCBUILD but I figure these could be sorted out by trial and error (worst case)

    Anyway, work responsibilities have sort of detracted from my ability to continue with this for now.  I'm happy to hand off what I've done so far or even work with you to develop it further.  We might be able to share some of the above between us....

    I think there's also a potential to add in something like the digital MARS compiler or gcc with one of the open source windows libs....to allow for the compilation of non-.Net CPP apps. 

    Thoughts?

    Tim Brooks

     

     

    Daniel Grunwald
    Filed under:
  • 10-28-2006 8:34 PM In reply to

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    Hi, 

    I have volunteered to develop the Sharp Develop C++ binding. At present I am in the design and planning stages and familiarizing myself with the SharpDevelop code base.  I have previous experience with proprietary IDE development, compiler integration, etc and so forth so feel as though I can do the job.  In a few weeks, in an appropriate place on this site, I will begin posting weekly progress reports. These will begin as architectural plans for the binding followed by coding progress. At some point, if deemed acceptable by the #Develop core team and contributors, it is hoped a beta form of this binding can be released. 

    Thanks for reading

  • 08-20-2007 4:45 AM In reply to

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    any updates with this thread?
  • 09-26-2007 6:57 AM In reply to

    • siegi44
    • Top 10 Contributor
    • Joined on 03-31-2006
    • Steyr, Austria
    • Posts 187
    • Team Members

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    Hi there,

    I'm working on a C++.NET binding too. But I'm stuck with the loading of the files in a project, because the project format of a C++.NET project seems to be completely different from the new c# format ...

    But if anyone has come further than me I can stopp my development!

    regards

    Siegfried
     

    Siegfried Pammer
    Filed under:
  • 09-26-2007 7:28 AM In reply to

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=793698&SiteID=1

    I don't know whether that changed for VS2008 or not (whose format should be goal anyways).

    Chris 

  • 09-26-2007 12:14 PM In reply to

    Re: I want to try C++ in SharpDevelop, but CPPNET binding can't compile

    Visual Studio 2008 still does not use MSBuild files for C++ projects. 

     
    I'm currently modifying SharpDevelop 3.0 to support non-MSBuild projects. There always was partial support for it in SharpDevelop; but compiling a solution would try to treat all projects as MSBuild, and I think there are some other problems, too.

    Daniel Grunwald
Page 1 of 1 (9 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.