I have searched for a while on this and have not found a good answer for it. (I am currently talking with GHS Support about this but wanted to post here to see if anyone had any experience with this. I will post an update after talking more with GHS.)
I am developing an embedded application using the Green Hills Software MULTI IDE and compiler. This is a C++ project. I am trying to port an existing .gpj project for use in Eclipse so I can take advantage of the development tools in Eclipse CDT. Has anyone had any experience doing this and could provide tips on it?
I of course want to develop in Eclipse and still compile with the GHS compiler with all of the options in my current .gpj file. Currently I have just had both applications open and have been developing the source in a separate Eclipse project and then compiling in the MULTI project manager with my current .gpj project.
This is discussed briefly here but no solutions are provided:
https://www.eclipse.org/forums/index.php/t/210115/
EDIT: I am open to any suggestions for using modern editors in the MULTI Project Manager (it doesn't have to be the Eclipse CDT). The main development tools needed are autocomplete of existing variables and going to the definition of classes and variables.
The solution that worked best for our group was to create Eclipse C++ projects that mimicked the settings in the .gpj project. To do this the source files were imported, the include paths set, the pre-processor directives were defined, and then the index was built. This way we could develop in Eclipse with all of the great tools it has. We also set up a Build Target to use the MULTI compiler and build the .gpj project through gbuild and have output in the Eclipse console. (see the figure below)
I talked with a support engineer at GHS and he did not recommend using the plug-in for Eclipse to integrate their compiler into Eclipse (our development has used many .gpj projects and we wanted to keep building our projects from the settings in the .gpj projects). He also did not recommend using gbuild to convert the .gpj into a makefile (he said the conversion is not always the best).
There are ways to change the default text editor in MULTI to something like Sublime Text, but creating an Eclipse project from the settings in our .gpj project has worked the best for us. We have done this process manually, and of course it could be automated with enough time.
Related
I am new to Linux and therefore feel difficult to code and develop in Linux based environment (CentOS).
Although coding is still fine, I find debugging a quite challenging task because of the lack of breakpoints and the ease of navigating through various class, function and variable definitions that we can do in the blink of an eye using Windows/Mac IDE's.
This leads me to the question :
Can I use a windows IDE to connect to my Linux system and import my project repository and develop on it?
I did some research on using Visual Studio 2017 for this purpose and found a few articles, but most of them explain how I start up with a new project rather than importing/developing upon an existing project.
I also had a look at an article that mentioned about Visual GDB but it wasn't very clear to me, so any pointers on how I can use that would be great.
Any other IDE that I can use on windows for the same purpose? (Visual studio is just something that I looked into, but any other suggestions are also welcome.)
NOTE: My project has both C and C++ code (networking domain), so hence both the tags.
Currently I'm transferring a c++ project into linux which was previously developed for windows with Visual Studio. I'm using Netbeans/Eclipse for the time being. So I'm wondering whether there is a more efficient way to migrate than that of creating a new c++ project and just adding the cpp and h files, since I have very little experience on VS.
I recommend you to use CMake. CMake is a cross-plattform build tool which allows you to build your program for different platforms. Like this you can also choose your IDE because CMake can build project files for different IDEs.
To start with CMake you should learn the basics as shown here.
I'm working on a cross-platform C/C++ code base that has Visual C++ (super majority) & XCode developers. It also needs to compile on Linux, because that's where it's deployed. We are currently using a complicated Unix makefile that's called from Visual C++, XCode, & Unix command line.
However, the makefile project causes several productivity losses for Visual C++ developers:
Slower build times
Intellisense & text search don't work well for files not directly referenced in project
No .h dependency generation (not clear how to do on Windows)
Adding a native Visual C++ project has the following downsides:
lots of work to manage all those separate platform configuration as mentioned here Maybe VC++ 2010's hierarchical property sheets will help.
more work due to syncing makefile with native project
Currently, I'm considering to add a native project for Windows developers. Can anyone offer their experience on what's best or suggest how those problems with either approach can be reduced.
I have considered CMake and personally would use it, but it's going to be hard to convince other people to learn cmake & syncing it with the native projects would be an issue.
I have considered CMake and personally would use it, but it's going to be hard to convince other people to learn cmake & syncing it with the native projects would be an issue.
The nice thing about CMake is that it builds ALL of the configurations for you. You would setup a single CMake project, and then use it to generate VS solutions, XCode projects, and unix makefiles for you.
It's a huge improvement - everybody gets to work in their "native" environment, whether they're on Windows, Mac, or Unix.
I've handled this by writing my own converter that would synch scripts for various embedded development environments. If something like the above answer of using CMake does all that for you, then that would be the way to go. But if its too complex, rolling your own custom tool is not that hard. Just has to synch both ways.
Also, if you don't have it. Visual Assist for visual studio is awesome :)
I am not a fan of makefile generators, cmake, qmake and the like.
I am a fan of make. We have a single makefile (well, several actually but they include each other and there is no recursive make involved) which knows all of the project dependencies on all platforms (windows, wince, linux, mac, ...). This gives:
Makefile is really no more than a list of sources (include dependencies are auto-generated during the build)
Same build command on each platform, apart from specifying the tool chain
Build uses all my CPUs
Very short time-to-do-nothing
Developers can use whatever IDE they fancy
vim, emacs, qtcreator, eclipse, XCode all in use
I often use VC++ when on Windows (for the debugger)
Scriptable. Great way to automate your tests
Nice.
I am starting to write a moderately sized project in C++ requiring a fairly large amount of files and dependencies on other projects.
Do you think manually maintaining a Makefile for this project is the best approach?
Are there other better alternatives for C++ that make build management and dependency management of files really easy to handle?
Also, what IDE is good for C++ development on Linux? I am comfortable with Vim, but do you think there are good IDEs for C++ (like Eclipse for Java) that provide code-completion etc?
Thanks!
Ajay
Others have already recommended using CMake. To my mind you should manage your project with CMake then decide on your favourite IDE.
CMake allows you to describe the project to be built, instead of how to build it. For example: I want to create a shared library called foo with source files a.cpp, b.cpp and c.h and it requires these link dependencies. Then on unix you get libfoo.so and on windows you get foo.dll and foo.lib. All common project settings can be abstracted up to higher levels in the build tree, this keeps most files very simple. More complicated requirments can be refactored into macros.
Once your project is described like this CMake will generate makefiles and/or IDE projects. This means each developer can choose their own IDE, as well as allowing you to mandate an IDE if appropriate.
My company use CMake to build the c++ in our product on windows and solaris. It contains 600 projects and 1.5 million lines of source code. We originally chose it as a cross platform build utility when porting to solaris, however for a large project like ours it is much easier to manage the build with CMake than with Visual Studio project files. I would recommend it as a build utility for any c++ project of any size
We use the eclipse cdt on solaris and are very happy with it. Most of our development is with visual studio on windows. cmake also works well with other ides I use it with KDeveloper4 on linux at home without a hitch.
KDevelop4 (from subversion or rc1 from their site) + CMake makes life so much easier, automake should just die.
If you want a cross-platform solution, netbeans + the c++ plugin are pretty decent, not as good as kdevelop4 though.
I like CMake a lot for the whole building process (but I have almost no experience with scons or Jam).
I use vim or qtcreator. Qtcreator is still in developpment, but very promising I think.
I suggest you Code::Blocks. I use it on Debian and works gracefully.
http://www.codeblocks.org/
Edit: Added another link
http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks
Eclipse does C++ as well - through eclipse CDT - not as comprehensive as Java but pretty good.
Manually maintaining Makefiles in larger Projects becomes quite painful. If you start using automake/autoconf, you will - after a while of learning all the facets - appreciate the powerful possibilities these tools can offer.
And as IDE simply use Emacs. It's quick, powerful and supports Code completion etc.
There's also Code::Blocks as an IDE with its own building system. But I would encourage you to try out other build tools (CMake, Boost.Build, SCons) if you want to be able to build your software "anywhere" without having a fancy schmancy IDE installed. ;-)
I found Emacs + Scons works pretty well for me.
I'm figuring out that there's two ways of writing C++ in Eclipse: either download the Eclipse IDE for C/C++ Developers or download the regular Eclipse for java and add the CDT plugin. What is the difference between these two? (Note that I'm already exstensively using Eclipse for Java) Thank you
The C++ tools end up the same so depends if you use Eclipse for other things.
If for other things then I would start with the more complex setup e.g. if you do Java J2EE I would download the Eclipse J2EE then add the C++ tools
If just C++ start with the Eclipse C++
I also found using the Yoxos/Eclipse Source packaging easier to download extra packages. (unless you need the absolute latest patch)
edit:
Sorry I did not read the question fully I have given the general answer. However as you have eclipse working and setup already and if you are happy then just download the C++ plugins. Note I have a separate workspace for java and C++ helps as you will want different perpecives etc and also cuts down on the projects in the explore rs/
Or use EasyEclipse for C/C++ and get a few other useful tools pre-integrated too.