首页
社区
课程
招聘
在Linux下make出现的错误
发表于: 2010-9-30 13:07 4359

在Linux下make出现的错误

2010-9-30 13:07
4359
[root@lab onscripter]# make -f Makefile.WinCE
arm-mingw32ce-g++ -finput-charset=cp932 -fexec-charset=cp932 -o onscripter.exe onscripter.o DirectReader.o SarReader.o NsaReader.o sjis2utf16.o ScriptHandler.o ScriptParser.o ScriptParser_command.o ONScripterLabel.o ONScripterLabel_animation.o ONScripterLabel_command.o ONScripterLabel_effect.o ONScripterLabel_event.o ONScripterLabel_file.o ONScripterLabel_file2.o ONScripterLabel_image.o ONScripterLabel_rmenu.o ONScripterLabel_sound.o ONScripterLabel_text.o AnimationInfo.o FontInfo.o DirtyRect.o resize_image.o  -static `/usr/local//bin/sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lSDL -lmad -lfreetype -ljpeg -lpng -lz -lbz2
/usr/local/mingw32ce/bin/../lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/bin/ld: cannot find -lpthread
collect2: ld returned 1 exit status
make: *** [onscripter.exe] 错误 1

ld: cannot find -lpthread 这个要怎么解决? 另一个人编译倒是出现ld: cannot find -luser32

[培训]科锐逆向工程师培训第53期2025年7月8日开班!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 50
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
在makefile的lib选项里面加上 -lpthread
2010-9-30 13:43
0
雪    币: 91
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
LIBS = -static `$(PREF)/bin/sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lSDL -lmad -lfreetype -ljpeg -lpng -lz -lbz2 -lpthread

这样么? 不行
2010-9-30 18:37
0
雪    币: 2109
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
cd /usr/local/mingw32ce/
find | grep pthread
如果只有 libpthread*.so
没有 libpthead*.a, 把 -static 移除即可.
(没有 *.a 不能用 -static)

如果在其他路径, 例如
./diet/lib/libpthread.a
加 -L/usr/local/mingw32ce/diet/lib

如果都没有, 又确定原程序有使用pthread:
5afK9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4y4G2N6i4u0U0k6i4N6S2M7X3g2Q4x3X3g2G2M7X3N6Q4x3V1k6H3N6r3S2J5k6h3q4V1M7#2)9J5k6s2N6A6L8U0x3J5i4K6u0r3

如果都没有, 又确定原程序没有使用pthread:
手动执行 sdl-config --libs
=> "-L/usr/local/lib -lSDL -lpthread"
把-lpthread 移除, 其他资料放入原位置.
2010-9-30 19:37
0
雪    币: 91
活跃值: (13)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
解决了 非常感谢
2010-9-30 21:06
0
游客
登录 | 注册 方可回帖
返回