|
From: | Václav Zeman |
Subject: | Re: Using libtool via autotools causes linking problem on mingw |
Date: | Fri, 8 Nov 2013 11:31:31 +0100 |
Hi,For some time I've been trying to compile my frameworkfor writing multimedia and 3d games in Guile Schemeon Windows/MinGW.The framework uses SDL library, and more details can befound here: https://puszcza.gnu.org.ua/projects/slayerAfter many issues with compiling Guile Scheme on MinGW,I've finally managed to achieve it, and having build SDL,I proceeded to compile my framework.Although I did use the autotools to create a package,I know only superficially how it is supposed to work.Having ./configured my project, I managed to build theobject files, but the final linking (performed by libtool)fails. It is invoked in the following way:./libtool --tag=CXX --mode=link g++ -D_GNU_SOURCE=1 -Dmain=SDL_main -Ic:/mingw/msys/1.0/include/SDL -Ic:/mingw/msys/1.0/include/guile/2.0 -I/usr/local/include -Ic:/mingw/msys/1.0/include -Wall -Werror -mwindows -Lc:/mingw/msys/1.0/lib -lmingw32 -lSDLmain -lSDL -Lc:/mingw/msys/1.0/lib -lguile-2.0 -lgc -mwindows -Lc:/mingw/msys/1.0/lib -lSDL_image -lmingw32 -lSDLmain -lSDL -g -O2 -mwindows -Lc:/mingw/msys/1.0/lib -lmingw32 -lSDLmain -lSDL -Lc:/mingw/msys/1.0/lib -lguile-2.0 -lgc -mwindows -Lc:/mingw/msys/1.0/lib -lSDL_image -lmingw32 -lSDLmain -lSDL -o slayer.exe file.o font.o image.o input.o slayer.o symbols.o video.o -lSDL_ttf
and the following error appears:c:/mingw/msys/1.0/lib/libmingw32.a(main.o): In function `main':e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/crt/main.c:91: undefined reference to address@hidden'collect2.exe: error: ld returned 1 exit status
However, I do manage to build the executable with the following command:gcc -o slayer.exe file.o font.o image.o input.o slayer.o symbols.o video.o -mwindows -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_ttf -lguile-2.0
(there are still some problems caused by libguile in the runtime, but at least the linkign stage succeeds)I know that it might be a complicated issue, and the cause might lie on the side of either MinGW or SDL or pkg-config or autotools or mine, but I thought it might be best to ask you first.The project's files can be browsed hereThanks in advance,M.
[Prev in Thread] | Current Thread | [Next in Thread] |