Code::Blocks Forums
User forums => Help => Topic started by: like2program on March 09, 2008, 02:34:53 pm
-
I can't compile an irrXML.cpp into irrXML.lib.
It should work and the code looks OK.
It would be great if someone could help.
Error Log:
Compiling: C:\Paintball Project\irrLicht\irrxml-1.2\src\irrXML.cpp
Linking console executable: C:\Paintball Project\irrLicht\irrxml-1.2\src\irrXML.exe
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0x104): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
From the looks of it Code::Blocks is broken...
-
Linking console executable: C:\Paintball Project\irrLicht\irrxml-1.2\src\irrXML.exe
You are *not* linking to a library but an executable (application). Thus you either need a main routine or you change your project setup to be a library project.
-
How would I change it to a library?
-
'Project' menu -> 'Properties' menu option -> 'Build Targets' tab
Right side of the dialog, 2nd field, is a pull down menu.
-
I can't click on properties.
It's un-selectable.
-
Ok I got it to build After creating a new project.
Thanks for your help.
-
Ok it works.. kinda.
I need it to build into a .lib not .a
how might I go about doing this?
If it is possible for that matter
-
.a are gcc's static libraries, .libS are usually used and created with/by msvc. As far as I know they are not interchangable.
-
In otherwords, since you're using gcc to compile the library you probably need the *.a file and NOT a *.lib file. Personally in my linker settings i always omit the file suffix completely and codeblocks handles it accurately. Just try using the *.a file and see if it works for the program that intends on using it.
-
Although gcc natively works on .a files, you can (at least under MinGW) use Microsoft's .lib files with gcc (no problem at all).
However, the same is not true the other way around.
-
did not know that. thanks.
-
After doing a little reading, Thank you very much for your help.
I will accept and love *.a :)
I really have to commend you guys in your efforts to make Code::Blocks the best IDE around.
Thanks once more,
L2P