SDL2_Gfx - 与cygwin的链接器问题

时间:2017-01-29 01:03:29

标签: c++ gcc cygwin sdl

我正在努力用cygwin编译SDL_Gfx。 配置脚本没有问题。

这是最后一个makefile命令:

/bin/sh ./libtool --tag=CC   --mode=link gcc  -g -O2 -I/usr/local/include/SDL2 -Dmain=SDL_main -no-undefined -release 1.0 -version-info 0:1:0  -o libSDL2_gfx.la -rpath /usr/local/lib SDL2_framerate.lo SDL2_gfxPrimitives.lo SDL2_imageFilter.lo SDL2_rotozoom.lo  -L/usr/lib -lcygwin -lSDL2main -lSDL2
libtool: link: warning: library `/usr/lib/libSDL2.la' was moved.

这是链接器“警告”消息。

*** Warning: linker path does not have real file for library -lSDL2main.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libSDL2main and none of the candidates passed a file format test
*** using a file magic. Last file checked: /lib/libSDL2main.a

如果我试图忽略这一点,当我尝试在我的应用程序中使用该库时,我收到此错误:

In function `pixel':
/usr/local/lib/SDL2_gfx-1.0.1/SDL2_gfxPrimitives.c:75: undefined reference  to `SDL_RenderDrawPoint'
/usr/local/lib/SDL2_gfx-1.0.1/SDL2_gfxPrimitives.c:75:(.text+0x11): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `SDL_RenderDrawPoint'

更新:我试图将编译器切换为使用mingw64而不是cywin。我有一个类似的问题,我认为这与libtool有关,因为我可以编译一个带有类似c / l标志的外部程序而没有问题。

我不知道我能尝试什么,我用完了想法,请帮忙。 谢谢

0 个答案:

没有答案