What should I use for coding C++ on a Mac and Windows? - c++

A group of students and I are making a C++ game, but they have Windows and I have a Mac is there something we can use to share code between the systems?
I know Eclipse will work but I get Unresolved conclusion: <iostream> as an error. If anyone can help with that it would be great.

If you want something to actually "share the code" with, I would recommend git using github as the remote location. Its free and easy to use.
If your question is about the code not working, make sure you have X11 configured properly, and have the Eclipse C++ plugin installed.
And I would also recommend using XCode as your editor instead of Eclipse. It has a much better environment for C++, IMHO.
Hope this helps.

Personally I'd recommend setting up a cross-platform build process using something like CMake (http://www.cmake.org). CMake in particular will generate platform-specific project files for you -- so your friends could be working in Visual Studio and you could be working in Eclipse or XCode, with no problems at all (of course, you'd have to write portable code... :))
As far as sharing code and version control goes, I agree with Jon that something like git is ideal.

We build our Windows+Mac+Linux apps using Qt, which includes a nice build system (qmake) and cross-platform APIs (so the same code will run on all OS's) and an IDE (which I haven't used but I hear is okay).
With multiple developers you'll definitely want some sort of source-code-management system as well, git and svn are both good choices there.

Related

XCode, Visual Studio, and GitHub with C++

I just learned the basics for git bash and GitHub, and I want to start using a repository for a simple console-based text game in C++ that I will be making. I have a MacBook laptop that I use to code on the go in XCode, and when I am home I use my Windows desktop in Visual Studio.
My question is "How do I run a C++ program from GitHub for both of these IDE's after I have cloned it?"
Should I just get the same IDE for both computers, like Eclipse? I've done quite a bit of research, but everything seems super complicated. I am hoping that there's an easier way, as I'm just a hobby coder. I'm definitely willing to learn; I just hate copying and pasting commands without understanding what they do. Any help is appreciated :)
Edited: Clarified that I know how to clone. The running part is what I don't know how to do.
There really are several ways to do what you're asking.
Store the project files with your repo, usually in a dedicated folder
msvc (with version)
xcode
makefile
qt creator
kdevelop
etc....
generalize the c++ with another build-system like CMake
The first option will/can get annoying but it is usually where most people starting to learn to program go. It isn't too bad so long as you realize you'll probably have problems sharing your project as no one has 'quite' the same exact setup as you.
The second option is where most projects usually end up. You need to learn the intricacies of something like CMake but once you learn, projects can be made for almost any IDE/environment.

How to organize Windows and Android builds of my C++ game?

I would like to develop a Windows build of my Android game for testing and demo purposes. Most of my code is C++, using OpenGL to render, with a thin Android/Java layer that forwards touch events and loads resources.
My first thought was to make a Visual Studio project for my Windows version, as I'm familiar with it and the debugger is excellent.
Can I get similar C++ debugging functionality with Eclipse & CDT? It seems tidier to have all versions working from the same IDE, and it would be nice to become less dependant on proprietary software. Would I be able to add a Windows build configuration in CDT, switch over, and have the IDE launch & debug my Windows version instead? Or would I be entering a world of pain setting this up?
Are there any other approaches I haven't considered? All advice welcome!
CDT is a perfectly good Windows development environment. Just make sure that you have installed the Windows SDK.
If the concern is that Visual Studio puts a lot of the Windows-specific code in place for you, you might consider starting a new project in it. I'd avoid MFC. Just create a new Win32 project. Then, you could take that code and use it as the basis for your Eclipse project, folding in the platform-independent code from your original Android game.
You can easily come up with a cross-IDE solution using makefiles. I guess cmake could help you here.
You could try out MPC. It can generate VS solutions or Eclipse CDT projects(and some more). I've been using it at my previous job and it's really neat once you get the hang of it(which shouldn't be very hard). I'm not sure how well does it work in a
cross-compilation environment, as we were using it to build our project on PC for Linux/Windows.
There's no reason why you shouldn't be able to use Eclipse on WIndows as well.
As far as I know though (I haven't used Eclipse for C++ that much), Visual Studio still has the best debugger. (it can also be a good code health check to compile it with more than one compiler). So there may be reasons to go with VS as well.
If you do decide to go with VS for the Windows version, you may want to look into CMake for managing the build system, since it can generate Visual Studio solutions as well as makefiles and pretty much anything else you may need to build.

Which IDE for C++ software can I use for targeting Windows, Linux and OSX?

I was reading today question on IDEs fo C++, and there are very good ones like Netbeans.
My question is about creating a software in C++ on Windows Environment, but let users install and run my software also on Linux and OSX.
Does netbeans has a compiler to do the job, or is there any good IDE which has a compiler for targeting my c++ code to these other environments?
thank you
QtCreator. It's awesome, slick and everything.
While it is not as feature rich as some competitors, it does many things just right that others don't.
I would say it is the one truly cross-platform IDE that is competitive to single-platform solutions. And it comes with tight integration of a very powerful and clean cross-platform toolkit. Something that you need for most cross-platform applications by itself.
I use Eclipse CDT and have had some degree of success. But I'm a Java programmer, so it's what I'm used to. It's worth checking out, and the extensions are quite cool.
Many people like Code::Blocks and it is cross-platform, with integrated debugging, code completion, etc. Qt Creator is also good and at least still very minimalistic.
Without a doubt VisualStudio with gnu make.
I've found Visual Studio to have the best IDE for C++. In addition, it's debugger and the way it handles multi-threaded applications is excellent.
And you can tweak the properties for your project to use different compilers and compiler flags of your choice, so it can build to any target.
You're talking about cross-compiling as GMan said, that's a compiler job, not IDE's and itu's kind of hard to make C++ software that runs well on Linux/Windows/MacOSX, C++ isn't a cross plataform language beacuse of its ABI, so you should try to use C++ standart code.
If you're making a consloe application there's no much problem just be care not to use system interface, but if you're planning to do some kind of graphics app then C++ it not the better choice for your purpose. Try some design that split the view from the controller/model of the app.
You can use QtCreator or NetBeans. First on C++ secord on Java. Both use MinGW g++.
Just a thought: you don't need to use a single IDE for all platforms. It is very common, for example, to use Visual Studio on Windows and Xcode on Mac OS X for cross-platform projects. I'm not familiar with Linux IDEs thought so couldn't recommend anything there.
Write makefiles for each OS? Simple enough seems to me.
Concerning cross plattform development it doesn't make a difference which IDE you use. Just make sure you use a cross platform (and possibly IDE independent) build system like SCons or cmake.

Good C++ Debugging/IDE Environment for Linux?

I have a friend who is trying to make the switch to Linux, but is hung up on the apparent lack of debugging/IDE environments for C++, especially as they relate to template programming. He has been using visual studio for years and is maybe a little spoiled by their awesome IDE. Does anyone have any good suggestions for an environment where he can, under Linux, develop and debug with all of the usual things (Breakpoints, line highlighting for compilation errors, step in/over/out/etc, etc) that he's accustomed to? Thanks!
How about Eclipse + CDT ?
Although many people think of it as a Java IDE, he could try NetBeans. I've used it on Windows for C and C++ development without a problem, and I know NetBeans is supported on Linux, so it would be worth a shot.
It looks like most of the features he wants are included in the C/C++ development toolkit, including integration with GDB, a profiler, and more.
Visual Studio is good, indeed.
On the free side:
Qt Creator is getting quite good too, it's worth a try. There are advantageous by-products coming from the Qt framework:
huge library - not only to build GUI applications but for other domains as well
portability on multiple platforms
A version 1.3 beta is available as a preview of the upcoming release but the current 1.2.1 is already all you need to manage projects.
Eclipse has already been mentioned, it's a very good environment offering many plug-ins (Mylyn, SVN, ...).
MonoDevelop somewhat supports C++ (more and more, I didn't check the latest version).
I've used Eclipse for C/C++ and it's pretty useful. It's also used at ACM ICPC World Finals http://cm.baylor.edu/welcome.icpc
I'd recommand Code::Blocks (but use a nighty build). It can be coupled with gdb to enable step by step debugging and all that stuff.
Not exactly an IDE but SublimeText 2/3 is available on Linux now. There may be a debugger plugin for it too, who knows.
Edit
Here's a gdb plugin for SublimeText
I havn't explored it personally, but Emacs has a C++ development addon that looks very much like a full IDE.
About 7 years ago I used KDevelop that was shipped with KDE. I found it quite good back than, and I hope it also improved with the time. I found it quite comparable to VC++ 6 at this time.
It also contains Qt support, if you are in need for some GUI toolkit.
Depends, Code::Blocks is good, Eclipse is very nice too, but you will need a very good computer. In my opinion the best choice iss gcc, gdb and ViM or Gedit.
My buddies from work use Eclipse + Scons, they also use Valgrind(spelling?) for tracking memory leaks and such.
Many of the IDE features you listed were debugger features. The ddd (Data Display Debugger) debugger is quite a nice GUI wrapper for gdb, allowing graphical representation of data structures, a non-crappy source listing window (ie. unlike the l command of gdb where you don't get context), and also allows you to use any and all native gdb commands directly if desired.
Have a look at CodeLite. It's available for Ubuntu and Fedora out of the box and even for Windows and Mac. So you can have the same IDE on different platforms.
We tried Eclipse and NetBeans but left them due to their huge CPU and memory usage. We have a development server and all the developers connect to it via RDC. Thats why these IDEs miserably failed in our model.
So, we looked for some native IDE. Found CodeBlocks to be very good and super fast. We sort of settled on it but later found CodeLite and liked it better than CodeBlocks.
I just seeing this question after 12+ years. AnyHow I just writing my answer. I personally use Quincy IDE for C and C++ development. it is very lite weight and debugging watch list is very much good and easy to use. I'm just attaching the link to the site. try it.
But you have to install it with wine.
Quincy <-- Click here

open source dev environment for C++: what's better? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I want to do some coding in my spare time, but the thing is, I don't want to spend the money on this.
Would the following set of development tools be The Right Thing, or is there something I'm forgetting?
Eclipse for C++
SVN for source control
Qt for UI development (since it's C++, and I believe it's now opened by Nokia)
hudson for continuous integration
I'd like to write a little image processing application that can run on any platform, but the main platform at the moment will be Windows with a possible movement to the Mac-- hence all the cross-platform tools.
Is there anything really obvious I'm forgetting? Like something like fxcop for style checking in C++?
If I use any libraries, I'd like to avoid GPL libraries; if things go south with my current employer, I'll want to monetize this.
Microsoft Visual C++ Express is free and easily the best IDE for Windows. Furthermore, you can use it to work on cross-platform code - it more depends on writing standards-adhering code and using portable libraries.
If you want to write cross-platform code, I recommend a cross-platform build tool. I use CMake, which generates Visual Studio solutions on Windows, but there are others too, such as SCons.
As for libraries, it depends on what exactly you need to do. Qt is an excellent GUI library. libpng/libjpeg and others are good for loading/saving images at a low level, but there are probably other higher-level image libraries as well.
[edit] A response to the comment about MSVC and Qt:
A quick search brings up Trolltech's Qt Visual Studio Integration page:
Qt Visual Studio .NET Integration
A comment points out that this is actually not free (a free addon is available at this link, but this runs Qt designer outside of Visual Studio. Also, the Express version of Visual Studio does not support plugins.
For coding specifically in Qt there is another new IDE created by Qt: Qt Creator. I've heard good things about it, and it is also portable across Windows, Linux, and Mac.
I detect procrastination (something I'm often guilty of) - just write some code - you can always add tools as you go along.
The problem with questions with phrases like "what's better" is that it's really hard to determine what's right in a specific situation and maybe impossible what's "better".
Said that, I use Eclipse CDT sucessfully as an IDE on Linux. I use frameworks like ACE/TAO to create code that is highly portable.
I know that QT is a very good UI framework. KDE is built on top of KDE and if you use KDE/Linux then you may also want to look at KDevelop, a C++ IDE that has many users.
In the end I believe that you and only you can figure out whats best for you to use. Make sure you check the alternatives and then make an educated decision.
for c++ there are a few more freewares available such as codeblocks and devcpp. I find eclipse very heavy on the machine.
There are many tools that make the difference:
A C++ compiler ... (it wasn't in your list)
doxygen
STLfilt (which is a must have when programming in C++)
A UT framework (CxxTests, boost.test, Fructose, google.test, ...)
something to manage the compilation chain (scons, aap, (b)jam, cmake, ...) -- I've no idea what eclipse is using.
Source control: git. It's not as diffucult as people make it seem. I'm an svn newbie and I still managed to learn the basics of git for use in everyday life! There are about 4 or 5 basic commands that will get you going in no time. Read the official git tutorial
Regarding IDE's, there are a few choices
Microsoft Visual C++ Express Edition (free lite version)
Eclipse with CDT
QtCreator. (Since you're using Qt for the GUI)
Personally I have used Eclipse+CDT for a number of projects. Paired with wxWidgets it has provided me with enough to keep myself pretty much crossplatform (which I think is a big plus).
Also QT has some interesting releases with an IDE now, make sure you check it out: http://www.qtsoftware.com/products/developer-tools
Like earlier suggestion, just start coding, you will eventually find out what is the appropriate mix for you. It varies greatly between individuals what is the "best" IDE or mix of command line tools, etc.
Eclipse CDT is making huge strides, and even organizations that were unx tools only are now finally joining the IDE bandwagon. Considering downloading a current milestone, not the official release.
If you're using windows, don't use Eclipse directly, find a third-party distribution that already has all the GNU tools in it (I forgot the name, I can look it up).
Once you switch to mac it's easier, but make sure to install xcode to get your GNU tools.
If you are using svn - VisualSVNServer is an excellent free GUI based way to setup and administer your SVN repository, definitely worth checking out as it means you have little/no messing about with config files etc. to change your repository.
Regarding version control - Subversion is pretty much standard and is very well supported. From what I've heard, Git is more powerful but harder to use; it's worth a look for a new one-man project, since you wouldn't have the support and retraining concerns that other projects would have.
Regarding IDE, since Visual C++ Express is currently the highest-voted answer - I've used both Eclipse and Visual C++ Express. I don't have a whole lot of experience with Visual C++ Express, so it might have features that I've overlooked, but from what I've been able to compare, Eclipse offers a lot more features. I tried to list its more impressive features in this answer; from what I've been able to see, Visual C++ Express doesn't have any of the features listed there. Eclipse is slower and more resource-intensive, but with a fast enough desktop, its extra features are more than worth it.
In terms of version control, use git and throw your project on GitHub or Gitorious. There's really no reason to use Subversion anymore, due to its painful branching and merging, and lack of a distributed model.
See this link here for why Git is better than X:
http://whygitisbetterthanx.com/
There's also no point in using Sourceforge or GNU Savannah, as the Git front-end sites have much more valuable features and are easier to use.