Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.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
c++;在linux中使用cmakefile.txt编译多个cpp文件 我对Linux和C++很陌生。我的源文件夹中有两个cpp文件和cmakefile.txt。如何使用g++在ubuntu中编译(多个cpp文件)_C++_Cmake - Fatal编程技术网

c++;在linux中使用cmakefile.txt编译多个cpp文件 我对Linux和C++很陌生。我的源文件夹中有两个cpp文件和cmakefile.txt。如何使用g++在ubuntu中编译(多个cpp文件)

c++;在linux中使用cmakefile.txt编译多个cpp文件 我对Linux和C++很陌生。我的源文件夹中有两个cpp文件和cmakefile.txt。如何使用g++在ubuntu中编译(多个cpp文件),c++,cmake,C++,Cmake,我有这个CMakeList.txt project(Test) # link_libraries($Nest_LIBRARIES}) subdirs( # engine options ui # jni ) #build the Test library add_library(test STATIC options/command_line_options.cpp options/options_map.cpp utility/timer.cpp

我有这个CMakeList.txt

project(Test)

# link_libraries($Nest_LIBRARIES})


subdirs(
#  
  engine
  options
  ui

#  jni
  )



#build the Test library
add_library(test STATIC
  options/command_line_options.cpp
  options/options_map.cpp
  utility/timer.cpp
  utility/generics/any.cpp
  util/hdfs.cpp
  logger/logger.cpp
  logger/backtrace.cpp
   )
requires_core_deps(test)
安装(目标) 测试存档目标库)

这是CMake()。有人说它简化了构建过程

  • 从CMake元文件创建makefile:
    CMake-G“Unix
    Makefiles“
  • 运行make:
    make-j2安装

  • 我收到一条错误消息“无法创建命名生成器unix make文件它是否说明了原因?请尝试从另一个提供源的完整路径的目录运行它,而不是在命令行中运行