Codelite中的链接器错误与MinGW-w64

时间:2015-11-05 12:32:21

标签: mingw-w64 codelite

我正在尝试在Codelite中使用MinGW-W64而不是MinGW。当我编译简单的“hello,world”项目时,它没问题。但是当我尝试链接一些库时,我得到一个奇怪的链接器错误。具有完全相同设置的项目由MinGW编译并解决任何问题。两种变体都有构建输出:

MinGW GCC 4.8.1

`C:\Windows\system32\cmd.exe /C D:/apps/mingw/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ code - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'D:/Projects/codelite/code'
codelite-cc D:/apps/mingw/bin/g++.exe  -c  "D:/Projects/codelite/code/src/main.cpp" -Wfatal-errors -g -O0 -pedantic -W -std=c++11 -Wall  -o ./Debug/src_main.cpp.o -I./inc/
D:/apps/mingw/bin/g++.exe -o bin/code @"code.txt" -L./lib/  -lopengl32
mingw32-make.exe[1]: Leaving directory 'D:/Projects/codelite/code'
====0 errors, 0 warnings====`

MinGW-W64 GCC 5.2.0

`C:\Windows\system32\cmd.exe /C D:/apps/mingw-w64/mingw32/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ code - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'D:/Projects/codelite/code'
codelite-cc D:/apps/mingw-w64/mingw32/bin/g++.exe  -c  "D:/Projects/codelite/code/src/main.cpp" -Wfatal-errors -g -O0 -pedantic -W -std=c++11 -Wall  -o ./Debug/src_main.cpp.o -I./inc/
D:/apps/mingw-w64/mingw32/bin/g++.exe -o bin/code @"code.txt" -L./lib/  -lopengl32
g++.exe: error: @code.txt -L./lib/: No such file or directory
mingw32-make.exe[1]: *** [bin/code] Error 1
code.mk:78: recipe for target 'bin/code' failed
mingw32-make.exe[1]: Leaving directory 'D:/Projects/codelite/code'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====1 errors, 0 warnings====`

1 个答案:

答案 0 :(得分:1)

这看起来像是工具链中的错误而不是CodeLite中的错误。 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.saud.nexustelecom" > <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" > <receiver android:name=".AlarmReceiver"></receiver> <activity android:name=".MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> plural.c:185:5: error: conflicting types for 'libintl_gettextparse' plural-exp.h:106:12: note: previous declaration of 'libintl_gettextparse' was here plural.c:1106:1: error: conflicting types for 'libintl_gettextparse' plural-exp.h:106:12: note: previous declaration of 'libintl_gettextparse' was here plural.c: In function 'libintl_gettextparse': plural.c:1275:7: error: too few arguments to function '__gettextlex' plural.y:57:12: note: declared here plural.y:154:29: error: 'arg' undeclared (first use in this function) plural.y:154:29: note: each undeclared identifier is reported only once for each function it appears in make[7]: *** [plural.o] Error 1 make[7]: Leaving directory `/home/mehmet/kernel/bcm_unified/trunk/uclinux-rootfs/user/e2fsprogs/intl' make[6]: *** [all-libs-recursive] Error 1 make[6]: Leaving directory `/home/mehmet/kernel/bcm_unified/trunk/uclinux-rootfs/user/e2fsprogs' make[5]: *** [all] Error 2 make[5]: Leaving directory `/home/mehmet/kernel/bcm_unified/trunk/uclinux-rootfs/user/e2fsprogs' make[4]: *** [all] Error 2 make[4]: Leaving directory `/home/mehmet/kernel/bcm_unified/trunk/uclinux-rootfs/user' make[3]: *** [base_fs] Error 1 make[3]: Leaving directory `/home/mehmet/kernel/bcm_unified/trunk/uclinux-rootfs' make[2]: *** [box-fs] Error 1 make[2]: Leaving directory `/home/mehmet/kernel/bcm_unified/trunk/uclinux-rootfs' make[1]: *** [box-fs-7231b0] Error 2 make[1]: Leaving directory `/home/mehmet/kernel/bcm_unified/trunk/uclinux-rootfs' development Linux image build failed. gnumake: *** [kernel] Error 1 之间有一个空格,由于某种原因,"@code.text"看不到它......

我把钱放在-L./lib工具上。您可以告诉CodeLite使用4.8.1版本中的g++(有效):mingw32-make

另一个选项是禁用告诉CodeLite生成mingw32-make.exe的选项,该选项通过文件将对象列表传递给编译器:

settings->build settings->compilers->[YOUR COMPILER NAME]->Make并取消选中该选项:通过文件将对象列表传递给链接器

相关问题