User forums > Using Code::Blocks
multiple file c++ project
MortenMacFly:
--- Quote from: thomas on September 04, 2007, 01:19:03 pm ---Add gdi32 to link libraries.
--- End quote ---
Right. BTW: Ths project contains a lot of executables that could be producers (I'm sure you realised the "multiple main" error). I have attached a slightly modified project for all the executables. Still: Some of them I have disabled int he virtual target "All" as they are depend on components I don't have. ;-)
[attachment deleted by admin]
Robert_S:
--- Quote from: thomas on September 04, 2007, 01:19:03 pm ---Add gdi32 to link libraries.
http://msdn2.microsoft.com/en-us/library/ms533964.aspx
--- End quote ---
I placed a copy of gdi32.lib into C:\MinGW\lib, I used a copy from an old vc98 installation as I do not have MSDN. I still receive the aforemetioned errors. I also pointed to it within the Global Variable editor.
Biplab:
GCC (MinGW) can't link your app against a VC compiled lib. You need to download the following package instead.
--- Quote ---http://downloads.sourceforge.net/mingw/w32api-3.10.tar.gz?modtime=1186139469&big_mirror=1
--- End quote ---
Robert_S:
--- Quote from: Biplab on September 04, 2007, 02:25:38 pm ---GCC (MinGW) can't link your app against a VC compiled lib. You need to download the following package instead.
--- Quote ---http://downloads.sourceforge.net/mingw/w32api-3.10.tar.gz?modtime=1186139469&big_mirror=1
--- End quote ---
--- End quote ---
Hmmm not sure I how I would go about using the win32api archive you quote. How would I use this?
I managed to get gdi32.lib to link by using Settings->Complier and Debugger-> selcting the linker settings Tab and pointing to gdi32.lib.
Now I get the following build log displayed...
-------------- Build: Debug in pdfinfo ---------------
Linking console executable: bin\Debug\pdfinfo.exe
obj\Debug\pdfinfo.o: In function `ZN6Object9getStringEv':C:/xpdf-3.02/xpdf//GString.h:(.text+0xa3): undefined reference to `parseArgs'
:C:/xpdf-3.02/xpdf//GString.h:(.text+0x13f): undefined reference to `printUsage
'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
Looking at the Gstring.h header, what does the reference to (.text+0x13f) refer to ? I can't see any reference to `printUsage'.
Just one last hurdle to overcome and hopefully I'll have a working binary. Thanks for all the input and assistance thus far :).
Could it be something to do with the following (taken from MS_MAKE.BAT):
GHash.cc, GList.cc, GString.cc, gmem.cc, gmempp.cc, gfile.cc, parseargs.c
Needing to be compiled as objects file and output as Goo.lib ?
and...
FoFiBase.cc, FoFiEncodings.cc, FoFiTrueType.cc, FoFiType1.cc, FoFiType1C.cc
Needing to be compiled as object files and output as fofi.lib ?
How do I produce library files to link in?
update:
Looking at the ms_make.bat file again I see I also need to link shell32.lib ,user32.lib, advapi32.lib. So I'll add these and see how I progress.
I've noticed MinGW\lib has the following libraries: libshell32.a ,libuser32.a, libadvapi32.a but no libgdi32.a there or in the linked above. Is there an alternative library or something to use?
thomas:
--- Quote ---GHash.cc, GList.cc, GString.cc, gmem.cc, gmempp.cc, gfile.cc, parseargs.c
Needing to be compiled as objects file and output as Goo.lib ?
and...
FoFiBase.cc, FoFiEncodings.cc, FoFiTrueType.cc, FoFiType1.cc, FoFiType1C.cc
Needing to be compiled as object files and output as fofi.lib ?
How do I produce library files to link in?
--- End quote ---
Look in the attached project, it does just that. The target goo builds the library libgoo.a, placed into the folder lib, etc.
--- Quote from: thomas on September 04, 2007, 11:49:28 am ---Oh, I forgot... you must add goo and fofi (and possibly splash) to the link libraries for the targets that build the 4-5 executables, else you will get missing references.
--- End quote ---
You really need to do that, too :)
If you add the lib folder to the linker's search paths (which is the good solution), you can just add goo, fofi, and splash to link libraries.
Alternatively, you can provide absolute paths or copy the libraries to the system lib folder (both aren't good solutions, though).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version