Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
重新排序gnu自动工具链接器标志 我在C++中使用GNU自动工具(AutoToCufIg是由Eclipse CDT自动生成的,但我想这并不重要)。我正在使用LLVM LIB,现在我面临着链接器标志顺序的问题_C++_Linker_G++_Autotools_Compiler Flags - Fatal编程技术网

重新排序gnu自动工具链接器标志 我在C++中使用GNU自动工具(AutoToCufIg是由Eclipse CDT自动生成的,但我想这并不重要)。我正在使用LLVM LIB,现在我面临着链接器标志顺序的问题

重新排序gnu自动工具链接器标志 我在C++中使用GNU自动工具(AutoToCufIg是由Eclipse CDT自动生成的,但我想这并不重要)。我正在使用LLVM LIB,现在我面临着链接器标志顺序的问题,c++,linker,g++,autotools,compiler-flags,C++,Linker,G++,Autotools,Compiler Flags,基本上,在构建项目时,eclipse执行“make”。Make执行许多命令,但最后执行g++编译器,如下所示: g++ -DPACKAGE_NAME=\"test\" -DPACKAGE_TARNAME=\"test\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"test\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"test\" -DVERSION=\"1.0\" -

基本上,在构建项目时,eclipse执行“make”。Make执行许多命令,但最后执行g++编译器,如下所示:

g++ -DPACKAGE_NAME=\"test\" -DPACKAGE_TARNAME=\"test\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"test\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"test\" -DVERSION=\"1.0\" -I.    `llvm-config --cppflags --ldflags --libs core` -g -O2 -MT test.o -MD -MP -MF .deps/test.Tpo -c -o test.o test.cpp
mv -f .deps/test.Tpo .deps/test.Po
然后链接器:

g++ `llvm-config --cppflags --ldflags --libs core` -g -O2   -o a.out test.o
问题是,如果参数“test.o”不在行的开头,链接器将失败,因此应该是:

g++ test.o `llvm-config --cppflags --ldflags --libs core` -g -O2   -o a.out

如何在Makefile.am或gnu autotools的任何配置文件中更改它?

我没有找到答案,但到目前为止,我发现LLVM与包含自定义automake系统的项目模板捆绑在一起,该系统以正确的方式处理所有内容

如果要访问该模板,可以在$LLVMSRC/projects/sample文件夹中找到它