hello forum,
I'm trying to cross compile with mingw32.
When I try to compile a hello world toy program I get a build log message saying the linker cannot find the Xrender lib.
this is the build instruction automatically given by the compile project button:
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 -g -I/usr/i586-mingw32msvc/bin -c /home/alessandro/Documenti/ProgC/AVOrder/main.cpp -o obj/Debug/main.o
i586-mingw32msvc-g++ -L/usr/i586-mingw32msvc/lib -o bin/Debug/AVOrder obj/Debug/main.o /usr/local/lib/libfltk.a -lXrender -lXcursor -lXfixes -lXext -lXft -lfontconfig -lXinerama -lpthread -ldl -lm -lX11
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: cannot find -lXrender
how can I strip this lib from the compiler build string ?
Both those fields are empty. But in compilation I still get those long list of library links.
I added the path to the folder containing the libXrender in the project->build options->search-directories->Linker tab and now it works.
Now I have a new problem.
I'm trying to build a FLTK program for the windows platform. No problems building it with gcc for linux.
The trouble is that the compiler complains she can find the header files with the function definitions.
How do I insert the folder where to find these header files?
||=== Build: Debug in FLTK_Test (compiler: MingW32) ===|
obj/Debug/main.o:main.cpp|| undefined reference to `Fl_Window::Fl_Window(int, int, char const*)'|
obj/Debug/main.o:main.cpp|| undefined reference to `Fl_Box::Fl_Box(int, int, int, int, char const*)'|
obj/Debug/main.o:main.cpp|| undefined reference to `Fl_Group::end()'|
obj/Debug/main.o:main.cpp|| undefined reference to `Fl_Window::show(int, char**)'|
obj/Debug/main.o:main.cpp|| undefined reference to `Fl::run()'|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Thank you
Ok, that are linker messages, but this is the build string
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))
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:
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
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.