User forums > General (but related to Code::Blocks)
mingw32 and Xrender
oBFusCATed:
Obviously it is not the compiler that is complaining, but the linker.
And obviously you have to link to the proper libs.
alexo:
Ok, that are linker messages, but this is the build string
--- Code: ---i586-mingw32msvc-g++ -I/usr/local/include -I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -c /home/alessandro/Documenti/ProgC/FLTK_Test/main.cpp -o obj/Debug/main.o
i586-mingw32msvc-g++ -L/usr/lib/i386-linux-gnu -L/usr/local/lib -L/home/alessandro/Scaricati/fltk-1.3.x-r11080/lib -L/usr/i586-mingw32msvc/lib -o bin/Debug/FLTK_Test obj/Debug/main.o /usr/local/lib/libfltk.a -lXrender -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 /usr/lib/i386-linux-gnu/libXrender.a
obj/Debug/main.o:main.cpp:(.text+0x7d): undefined reference to `Fl_Window::Fl_Window(int, int, char const*)'
obj/Debug/main.o:main.cpp:(.text+0xbf): undefined reference to `Fl_Box::Fl_Box(int, int, int, int, char const*)'
obj/Debug/main.o:main.cpp:(.text+0x125): undefined reference to `Fl_Group::end()'
obj/Debug/main.o:main.cpp:(.text+0x13e): undefined reference to `Fl_Window::show(int, char**)'
obj/Debug/main.o:main.cpp:(.text+0x146): undefined reference to `Fl::run()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
5 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
the library fltk.a in /usr/local/lib is already present in the build string but I still have errors.
Isn't it an error due to the fact that the #include file are not found?
This is the working build string used by the gnu gcc compiler:
--- Code: ---g++ -I/usr/local/include -I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -g -c /home/alessandro/Documenti/ProgC/Inserimento_ordine_client/main.cpp -o obj/Debug/main.o
g++ -o bin/Debug/Inserimento_ordine_client obj/Debug/main.o /usr/local/lib/libfltk.a -lXrender -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11
--- End code ---
it is neater and less messed up.
I am not able to manually edit them. I've tryed to add the library path in every project build option's linker field but nothing happpened.
oBFusCATed:
--- Quote from: alexo on February 13, 2016, 10:58:49 am ---Isn't it an error due to the fact that the #include file are not found?
--- End quote ---
No, these are linker errors. Linkers don't read includes or sources.
They work with object files, static libraries (archives of object files) and shared libraries.
The problem you're having is that you're trying to use a native gcc built library with the mingw-gcc compiler.
So you want to use a linux library to produce a windows executable. This won't work by design.
You need to rebuild every library you want to use with mingw-gcc compiler.
alexo:
And you are a genious,
I hadn't the faintest idea that could be the problem.
I'll try to compile the lib and I'll let you know. Cross compilation without external libraries work perfectly.
But, I think I've found a bug in the 16.01 version of C::B.
I obtain it after trying to remove clicking Delete a manually installed compiler (via the copy button).
Or at least this is the trouble I'm getting trying to remove Mingw and willing to reinstall it freshly.
Anyway, thank you oBFusCATed
oBFusCATed:
What are the exact steps needed to reproduce this?
Can you expand the backtrace and post it?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version