🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

FTGL Cross Compile

Started by
0 comments, last by Bregma 15 years, 9 months ago
Hi, I have done some cross compiling (from linux to windows) for my OpenGL program before. Now I am using FTGL (font library) and I try to do cross compiling using Mingw32 (for linux). I already copied all the included and src files to my Mingw32 compiler's directory (and also the lib files). But I still got this error :

/tmp/ccAPEWsK.o:main.cpp:(.text+0x10fb): undefined reference to `FTPixmapFont::FTPixmapFont(char const*)'
/tmp/ccAPEWsK.o:main.cpp:(.text+0x1175): undefined reference to `FTSimpleLayout::SetFont(FTFont*)'
/tmp/ccAPEWsK.o:main.cpp:(.text+0x118b): undefined reference to `FTSimpleLayout::SetLineLength(float)'
/tmp/ccAPEWsK.o:main.cpp:(.text+0x1494): undefined reference to `FTSimpleLayout::Render(char const*, int, FTPoint, int)'
/tmp/ccAPEWsK.o:main.cpp:(.text+0x1524): undefined reference to `FTSimpleLayout::FTSimpleLayout()'
/tmp/ccAPEWsK.o:main.cpp:(.text+0x1543): undefined reference to `FTSimpleLayout::~FTSimpleLayout()'
collect2: ld returned 1 exit status
make: *** [all] Error 1


Here's my makefile:

 i586-mingw32msvc-g++ -I/usr/i586-mingw32msvc/include -L/usr/i586-
mingw32msvc/lib main.cpp -o main.exe -lfreetype -lftgl -lglfw -lglfwdll 
-lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 
-lctl3d32 -lodbc32 -ladvapi32 -lodbc32 -lwsock32 -lopengl32 -lglu32 -lole32 
-loleaut32 -luser32 -lkernel32 -luuid -mwindows


I already included the -lfreetype and -lftgl into the parameter, is anyone knows about this problem? Have anyone try to do cross compiling with FTGL library in linux? Thanks for the help.
Advertisement
Just so it's clear, you're using a i386-linux-gnu host/build crossed to a i586-mingw32msvc target?

You're including the directory /usr/i586-mingw32msvc/lib in your library search path. I am assuming that's what you mean by the "compiler's directory." Can you use your toolchain's objdump or nm tool to check of the missing symbols are in fact found in the (I assume) libftgl.a file in that directory, or perhaps one of the other libs? Don't forget that link order is important.

Are you sure the format of the libraries are compatible with your target architecture? A cross target like i586-mingw32msvc sounds like a COFF target to me. Are your libs COFF or ELF?

Stephen M. Webb
Professional Free Software Developer

This topic is closed to new replies.

Advertisement