Hi
I need your advice on the most suitable IDE/compiler for creating cross-platform programs, by that I mean so that I can compile the source code for a program to run on Linux, and also compile the same source for it to run on Windows.
Thank you.
Hi
I need your advice on the most suitable IDE/compiler for creating cross-platform programs, by that I mean so that I can compile the source code for a program to run on Linux, and also compile the same source for it to run on Windows.
Thank you.
Its not so much your compiler as its the code you write. As long as you write code that is standards complient you should be able to port it to any OS
Last edited by prog-bman; 06-18-2004 at 12:19 AM.
Woop?
Even so, which IDE guides you to make your code more portable? I heard and read around that, for example, Visual C++ from Microsoft don't really cater for portable code, but it seems to be Borland IDEs do. What do you think?
I would say go with Dev-C++ it uses MinGW a windows port of of GCC which is a very standards compatble compiler plus its free
Woop?
If you always start with empty projects, I see no problems with VC++ and xp-code.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Thanks guys - just one last question, how does the Borland IDE compare to the Visual Studio IDE, generally? Which one do you use? Thanks again.
I personally havn't used borland or MS but i like dev. It's very user friendly plus if your just starting its free.
Here's a link:
www.bloodshed.net
Woop?
Thanks - I'll check it out. I've coded in c++ before, but I'm a bit rusty since I haven't done so in a while.
I googled a bit and found the following information helpful:
http://www.mozilla.org/hacking/portable-cpp.html
Just put it here in case someone has the same question as me.
Last edited by Sul; 06-18-2004 at 09:18 AM.
I use Dev-C++ as well. I've used the MS.NET compiler, and have a copy of the borland compiler, but haven't used it. I personally like dev ALOT more than MS, but MS kinda holds your hand through the process... either way, if you start out with a blank file/project (console app), you shouldn't have any problem porting your code unless you use non-standard headers...
I would go for Dev-C++, because it uses a port of the same compiler used on *nix boxes, and follows standards closely... and it's free... and it's open-source... and it's constantly updated...
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
YOU NEED MULTIPLE COMPILERS
Normally, you compile the code on the "target" machine. For example, you would use Dev-C++ to write your code, and compile to the Windows exe file. Then, you'd copy the source files to your linux machine, and compile it again with a linux compiler. Or if you have a dual-boot machine, you can boot to linux and recompile.
There are cross-compilers that can compile for a different platform, but these are generally used when its not possible or practical to complie on the target platform. If you were writing code for an automobile cruise-control, you would compile on your PC (using a special compiler), and then download the machine code to the target system which is not running Windows and may not have an x86 compatable processor.
ALMOST ALL REAL-WORLD PROGRAMS CONTAIN NON-STANDARD CODE
You have probably noticed that most commercial programs are avaliable for only one platform. Often, when there is a Mac and a PC version, they will be released at different times and be at different version numbers. This is a clue to how difficult it is!
There is no color, graphics, mouse, or sound in standard C++. All of this user-interface shtuff is system-specific. (There are cross-platform GUI libraries.)
DON'T GET ME WRONG
One of the things that makes C/C++ so useful and popular is the fact that there is a solid widely-accepted language standard. And, the language standard language does not require any particular hardware.
If you are really good, you will write the "core" of your program in standard C++, and put all of the platform-specific code in separate modules.
Last edited by DougDbug; 06-18-2004 at 06:48 PM.
If you are really worried about portability, then make sure that system-specific code is abstracted out. That is, wrap the system-specific code in an interface, so that only the particular implementation of your feature needs to be modified when you change platforms. Since you have a uniform interface, you won't need to change anything else.
Additionally, trying to make use of cross-platform libraries when possible helps. For example, Qt is a cross-platform GUI library. These libraries, however, rely primarily on the method mentioned above: one interface, many implementations.