配置过程项目文件中的错误可能无效

时间:2018-07-23 19:06:16

标签: c++ windows cmake

我在Visual Studio 14 2015创建的项目上,在Windows 10上使用cmake版本3.11.2遇到此错误。我已经在Windows 7的同一项目上使用过cmake,但在Windows 10中似乎没有用。

选择Windows SDK版本以Windows 10.0.17134为目标。

CMake Error at C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/Compiler/._ADSP-DetermineCompiler.cmake:1:
  Parse error.  Expected a command name, got bad character with text "".
Call Stack (most recent call first):
  C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeCompilerIdDetection.cmake:6 (include)
  C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeCompilerIdDetection.cmake:32 (_readFile)
  C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCompilerId.cmake:128 (compiler_id_detection)
  C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCompilerId.cmake:147 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCompilerId.cmake:31 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCCompiler.cmake:112 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt


Configuring incomplete, errors occurred!

See also "C:/Users/Ali/Desktop/Projekt1/build/CMakeFiles/CMakeOutput.log".

在日志文件中没有任何用处。只是:系统是:Windows-10.0.17134-AMD64

我已经检查了stackoverflow上的所有其他线程,但是找不到解决方案。 有没有人遇到相同的错误,或者不知道该如何解决?

2 个答案:

答案 0 :(得分:0)

import org.apache.jmeter.control.LoopController; import org.apache.jmeter.engine.StandardJMeterEngine; import org.apache.jmeter.protocol.http.sampler.HTTPSampler; import org.apache.jmeter.testelement.TestElement; import org.apache.jmeter.testelement.TestPlan; import org.apache.jmeter.threads.SetupThreadGroup; import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.collections.HashTree; public class JMeterTestFromCode { public static void main(String[] args){ // Engine StandardJMeterEngine jm = new StandardJMeterEngine(); // jmeter.properties JMeterUtils.loadJMeterProperties("c:/tmp/jmeter.properties"); HashTree hashTree = new HashTree(); // HTTP Sampler HTTPSampler httpSampler = new HTTPSampler(); httpSampler.setDomain("www.google.com"); httpSampler.setPort(80); httpSampler.setPath("/"); httpSampler.setMethod("GET"); // Loop Controller TestElement loopCtrl = new LoopController(); ((LoopController)loopCtrl).setLoops(1); ((LoopController)loopCtrl).addTestElement(httpSampler); ((LoopController)loopCtrl).setFirst(true); // Thread Group SetupThreadGroup threadGroup = new SetupThreadGroup(); threadGroup.setNumThreads(1); threadGroup.setRampUp(1); threadGroup.setSamplerController((LoopController)loopCtrl); // Test plan TestPlan testPlan = new TestPlan("MY TEST PLAN"); hashTree.add("testPlan", testPlan); hashTree.add("loopCtrl", loopCtrl); hashTree.add("threadGroup", threadGroup); hashTree.add("httpSampler", httpSampler); jm.configure(hashTree); jm.run(); //NEED HELP ON HOW TO GET RESPONSE FROM THE EXECUTED REQUEST } } 下,不应有以Modules/Compiler/开头的文件。可能是从外部驱动器复制CMake时获得的,该驱动器具有隐藏文件等文件。例如。 from MacOS

要么删除以._开头的文件,要么在没有它们的情况下重复CMake的复制。

答案 1 :(得分:0)

感谢@Tsyvarev 的回答!我从未听说过 macOS 文件系统元数据会导致问题。

如果您在 macOS 上获取 cmake 文件并tar,您会得到这个。一种解决方案是在压缩时使用 --disable-copyfile 以避免这些文件:

tar --disable-copyfile -czf cmake-3.19.6-rh6.tgz ./cmake-3.19.6-rh6/