Compilers

Started by
28 comments, last by Rebooted 20 years, 4 months ago
Yeah, I''m a C++ programmer, not Java.

How do I set up GCC as a cross compiler?
Advertisement
quote:Original post by Shard
Yeah, I''m a C++ programmer, not Java.

It''s generally preferrable to be a "programmer" rather than a "C++ programmer" or a "Java programmer".
quote:
How do I set up GCC as a cross compiler?

http://www.mingw.org/mingwfaq.shtml#faq-cross

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
I''ve done a Google search on the cross compile topic. Most pages only deal with Linux -> Windows, the one page that mentions Windows -> Linux says ''requires compiler tweaking'' and ''complicated'' (I recommend reading it, along with subpages).

Also: If you want to test the compiled apps, you''ll need a Linux system. And if you''ve got that it''d be easier to use it for compiling too.

Just as a side note: I''m running a dual boot WinXP/Debian without problems. The Debian system was installed after Windows was on the box, and I use Lilo at boot time to start up the respective system. If you don''t want to go to the trouble of installing a secondary system, you could try out Knoppix which is startable from a CD and should be fairly easy to set up.
How do I set my laser printer on stun?
Cross Compiling seems like a lot of hard work. I''ll get a version of Linux I can run from a CD to test and compile on.
quote:Original post by Wildfire
quote:
But for your question is simple answer. Java compiler could do that with less code modifications than other compilers. ~_^

Last time I checked Java (VM) was an interpreter, not a compiler? Basically you''re right of course But, excuse my ignorance, I don''t think Java is very suitable for high end games.


You can call Compiller.disable() from your application and force VM to run in just interpreted mode. Standard behavior is: if it would run more than once - compile it. No binary is writen on HD however, so it might be iteresting to add exe cache to VM. (viruses would be happy. ^_^ )

I tried both and found that Java is less messy and differences aren''t that hight. As long as you aren''t pointer arithmetic maniac.

Shard: "Yeah, I''m a C++ programmer, not Java."

That''s bad, you''d have a lot of problems. Best idea would be win/linux dualboot, but it won''t solve problems with MAC. Be prepared for alot of "a blind programming".
As a sidenote. I know aprox 6 languages and I''m using at least 3-4 regulary. I would recommend anyone to learn more than one language. So he wont be locked in just one.
In case you're interested, here's my take on the different C/C++ compilers.

MinGW32/GCC:
I have used the MinGW32 release of the GCC compiler for several years. Although it takes some configuration that is not immediately apparent to the beginning programmer, it consistently produces clean, fast-running, and (best of all IMO) small executables. F'rinstance, I made an image-loading program for Windows 9x using the OLE, and the end executable size (no other files needed) was 20.5 kb; once I ran UPX on it it was 9 kb. My experience has been that GCC makes you use better coding practices; things that MS Visual C++ allows are not allowed with GCC.
Another thing to note is Bloodshed Software's Dev-C++ kit: it's an IDE that's very similar to VC++, and uses the MinGW32 compiler system.

Microsoft Visual C++:
I got MSVC just a few days ago, so I don't know everything about it yet, but here's what I do know: it's quick, and easy to use. What I mean by quick is, the compile time is fast. VC++ has lots of great features, code completion, function indices, etc., and you can get your program up and running quickly with the templates. Debugging is also easy (well, since GCC doesn't come with a debugger, that's certainly favorable). However, the VC++ compiler seems to produce larger executables, even with all the release optimizations.
The reason I used MinGW32 so long, and what endears it to me above MSVC, is that it's free, of course.

Then there are a few other compilers out there: LCC, Borland C/C++, DJGPP; which I don't know much about. Actually, DJGPP and MinGW32 use the GCC compiler, but you can pretty much take what I said about MinGW32 and apply it to the GCC compiler.

Twilight Dragon

[edited by - TDragon on December 2, 2003 11:05:18 PM]

[edited by - TDragon on December 2, 2003 11:07:13 PM]
{[JohnE, Chief Architect and Senior Programmer, Twilight Dragon Media{[+++{GCC/MinGW}+++{Code::Blocks IDE}+++{wxWidgets Cross-Platform Native UI Framework}+++
quote:Original post by Raghar
I tried both and found that Java is less messy and differences aren''t that hight. As long as you aren''t pointer arithmetic maniac.


That must be me I like Java (having recently started doing serious work with it), but I can''t get over the habit of trying to check for valid objects by doing:
Object xyz = null;...if(!xyz) throw new Exception("..."; 
C++ is far from platform intependent in terms of compiling.

These guys now it:
http://www.mozilla.org/hacking/portable-cpp.html#dont_use_templates
quote:Original post by Captian Goatse
C++ is far from platform intependent in terms of compiling.

These guys now it:
http://www.mozilla.org/hacking/portable-cpp.html#dont_use_templates


Wow, that document was great for a laugh. What compiler are they using, MyFirstCrossPlatformCompiler 1.0?
That doc is from 1998 btw, the same year the standard came out. So I suppose it''s understandable. It certain is not relevant today.

"don''t use: templates, exceptions, rtti, namespace"
Gimme a break!

This topic is closed to new replies.

Advertisement