VisualStudio / GCC compatibility

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.

six comments, already:

Ah thanks ! :D
I don’t care if GCC’s executables are bigger… if it works.
Aranoth (link) - 05 01 07 - 19:07

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

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

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 () - 06 01 07 - 17: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 () - 06 01 07 - 20:06

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 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.
etcaptor - 07 01 07 - 01:49

Remember personal info?
Email (optional):
URL (optional):
Enter "layered" (antispam):
Comment:Emoticons / Textile

  ( Register your username / Log in )

Notify: Yes, send me email when someone replies.  

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Note: If you type in your email adress above, it will be visible to other visitors, although it will be hidden for bots using javaScript.