【问题标题】:Added and removed file in VisualStudio - compile errors在 Visual Studio 中添加和删除文件 - 编译错误
【发布时间】:2012-05-08 18:33:34
【问题描述】:

我的主要问题是:我从 ProjectMappen-Explorer(项目资源管理器)中删除了文件,然后再次添加它们。 现在项目不再编译,我不知道为什么。

如何让它再次编译?

项目是由 cmake 生成的,这也是一些很大的开销。

并且:我想自己添加文件,这会导致同样的问题。所以重新生成是没有用的。

感谢您的帮助!

错误 1

Fehler  1   error MSB3073: Der Befehl "setlocal
"C:\Program Files (x86)\CMake 2.8\bin\ctest.exe" --force-new-ctest-process -C Debug
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" wurde mit dem Code 8 beendet.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets   113 6   RUN_TESTS

错误 3

Fehler  3   error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: bool __cdecl SolidMesh::PointInPolygonAlgorithm::pointInPolygon(class osg::Vec3f)" (?pointInPolygon@PointInPolygonAlgorithm@SolidMesh@@QEAA_NVVec3f@osg@@@Z)" in Funktion ""public: static bool __cdecl DomAdapter::PointInPolygon(class osg::Vec3f const &,class osg::ref_ptr<class osg::TemplateArray<class osg::Vec3f,10,3,5126> > const &)" (?PointInPolygon@DomAdapter@@SA_NAEBVVec3f@osg@@AEBV?$ref_ptr@V?$TemplateArray@VVec3f@osg@@$09$02$0BEAG@@osg@@@3@@Z)".   C:\Users\wollknaeul\Documents\HPI\algorithmische geometrie\algogeometrie\trunk\build\algorithmtest\PointInPolygonTest.obj   test_Algorithm

错误 4

Fehler  2   error MSB6006: "cmd.exe" wurde mit dem Code 9009 beendet.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets   151 6   run

问题解答

in>"C:\Program Files (x86)\CMake 2.8\bin\ctest.exe" --force-new-ctest-process -C
 Debug
Test project C:/Users/wollknaeul/Documents/HPI/algorithmische geometrie/algogeom
etrie/trunk/bin
    Start 1: test_Algorithm
Could not find executable test_Algorithm
Looked in the following places:
test_Algorithm
test_Algorithm.exe
Debug/test_Algorithm
Debug/test_Algorithm.exe
Debug/test_Algorithm
Debug/test_Algorithm.exe
Unable to find executable: test_Algorithm
1/1 Test #1: test_Algorithm ...................***Not Run   0.00 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.11 sec

The following tests FAILED:
          1 - test_Algorithm (Not Run)
Errors while running CTest

【问题讨论】:

  • 错误 1 当 CMake 没有权限在安装文件夹中安装文件时,我得到了这个。您是否以管理员权限运行 Visual Studio?

标签: visual-studio visual-studio-2010 qt cmake


【解决方案1】:

以管理员权限运行 Visual Studio。错误基本上是 CMake 无法访问 C:/Program Files (x86) 目录来创建/添加必要的文件。

【讨论】:

    【解决方案2】:

    解决方案

    右键单击项目 -> 重建再次构建。 “新厄斯特伦”


    错误 1

    您的第一个错误是 MSB3073,听起来像是构建前或构建后问题,特别是在构建前或构建后事件上运行的脚本的某种错误。

    (通过 translate.google.com 从德语翻译):

    命令 "setlocal "C:\Program Files (x86)\CMake 2.8\bin\ctest.exe" --force-new-ctest-process -C 调试 if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd :VCEnd" 以代码 8 退出。C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 113 6 RUN_TESTS

    你能从批处理文件中运行这些脚本吗?

    错误 3 (2?)

    您的第二个(第三个?)错误是 LNK2019

    错误 4

    Google 有一堆关于你上一个错误 MSB6006

    的资料

    【讨论】:

    • 我只是在管理器中添加和删除了一个文件——它并没有改变磁盘上的文件。我尝试运行它。
    • @user1320237 你介意把它标记为答案吗?看起来错误出现在您的预/后构建脚本中。至少从你的更新中听起来是这样的。
    • 有人过来帮了我,所以这不是答案...我会在上面写答案,但不是你。
    • 我把问题的答案移到了这里。答案不应该写在关于 SO 的问题中。
    • 我收到类似的错误,错误 MSB3073: The command "setlocal "C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake if %errorlevel% neq 0 goto :cmEnd 返回 1 以管理员身份运行 VS 无法解决,我发现 cmake 文件没有任何问题。有人找到解决方案了吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-06
    • 1970-01-01
    相关资源
    最近更新 更多