Visual Studio 15.8使用错误的包含路径在Linux上交叉编译g ++

时间:2018-09-18 07:57:05

标签: c++ visual-studio msbuild g++ cross-compiling

由于过去的更新之一,我无法再交叉编译我的linux C项目。我弄清楚了原因。 %(AdditionalIncludeDirectories)生成错误。我的linux项目对共享项目有多个引用。该代码已正确复制到远程设备,但是包含路径不匹配。这是我的g ++构建命令,它是由MSBuild生成的:

g++ -c -x c /home/myUserName/projects/ProjectToBuild/SharedProjectA/client.c \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectB \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectC \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectA \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectD \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectE \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectF \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectB \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectC \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectA \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectD \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectE \
-I /home/myUserName/projects/ProjectToBuild/../SharedProjectF \
-g2 -gdwarf-2 \
-o "/home/myUserName/projects/ProjectToBuild/obj/x86/Debug/client.o" \
-Wswitch -W"no-deprecated-declarations" -W"empty-body" -Wconversion -W"return-type" -Wparentheses -W"no-pointer-sign" -W"no-format" -Wuninitialized -W"unreachable-code" -W"unused-function" -W"unused-value" -W"unused-variable"  \
-O0 -fno-strict-aliasing -fno-omit-frame-pointer  \
-DLINUX -D_DEBUG -D_CONSOLE
-fexceptions -std=c11

问题出现“ /../”,这是错误的。如果删除它并手动运行build命令,则编译成功。如何解决?

此外,所有共享项目都包含两次。但我认为,此错误无关紧要。

0 个答案:

没有答案