VisualStudio / GCC compatibility

Posted on:January 05 2007

Because lots of people already were asking, I just tried out to use irrKlang with the GCC compiler. There are always two problems when trying to use C++ binaries together produced by both compilers: ABI and name mangling. Fortunately, because irrKlang is currently only exposing very simple pure virtual COM-like classes, the ABI is not a very big problem: When manually loading the createIrrKlangDevice()-method from irrKlang via LoadLibrary and GetProcAdress to circumvent the name mangling problem, you can use irrKlang 0.3 from GCC compiled programs, but this is very dangerous (I also only tried it out very shortly with a very simple example program) and still might lead to unexpected crashes.
So I recompiled the irrKlang source using GCC (surprisingly without the need to change much of the code) which I will upload in the next few days, for all the GCC users out there. Interesting is the huge difference in size of the binaries:

Even with size optimizations and stripped symbols, I don't know how GCC is able to produce that huge programs. Maybe some performance comparison would be interesting as well.





Comments:


Ah thanks ! :D
I don't care if GCC's executables are bigger... if it works.
Aranoth
Quote
2007-01-05 19:07:00


yeah espacially executeables are huge in comparison with the msvc ones
Halan
Quote
2007-01-05 20:23:00


For what I know, the gcc executables are bigger, because the iostream stuff is statically linked to it.
schelm
Quote
2007-01-05 23:51:00


GCC produces larger C++ compiled programs (on Windows), because it links runtime library statically (inside exe/dll).
Try to do same with Visual Studio compiled exe/dll (change Runtime property inside Code Generation). And then compare with GCC.
bubu
Quote
2007-01-06 17:00:00


The difference is interesting, but VS is simply the most optimised C++ compiler for windows. But either way, I don't realy care as long as it works good.
And let's not forget most games comes with loads of datafiles, so it's not important if an executable is either 1 or 2 MB, if the whole game is about 100 MB anyway.
Very good work niko, and thanks for taking the time to make a GCC version!
jasper
Quote
2007-01-06 20:06:00


Seems compatibility today is far away from 1990. Indeed any part of code treats from different compilers varied - it's boredom and spends a time. I personally was paid Borland compiler and still stay with CBuilder, despite Borland lost many users with their bad managment. For me Kilix - was C++Builder for Linux, but Borland deceived their users and at this time you can use Kilix only with kernel 2.4
Microsoft contrariwise are full with many updates. I suggest that an apllication with their VS net 2003 must be corrected to run with their new CLR 2005. Since I remember from last year Irrlicht.net was writen with 2003 ver., but this is "obsolete" according Microsoft.
At first time when trying to compile Irrlicht wiht Borland compiler I lost several days... IrrKlang is not with full sources since I know /right?/ Have you tried to compile it with any Borland compiler? One free IDE is C++TurboExplorer free Version of BDS2006.
http://www.turboexplorer.com/cpp
etcaptor
Quote
2007-01-07 01:49:00


Add comment:


Posted by:


Enter the missing letter in: "I?ternational"


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons