1
當我嘗試編譯我的程序make
時,我得到一個未定義的對主錯誤的引用。然而,主要存在於我的src目錄中,我對我做錯了什麼感到失落。CMake undefined引用主
我假定add_executable([title] [source])
是用來將源文件添加到編譯中的命令。
基於CMake的教程
cmake_minimum_required(VERSION 2.6)
project(opengl_02)
add_executable(opengl_02 opengl_02.cpp)
add_executable(main main.cpp)
add_executable(geometrics geometrics.cpp)
set (opengl_02_version_major 1)
set (openfl_02_version_minor 0)
#configure the header file to pass some of the CMake settings
#to the source code
configure_file(
"${PROJECT_SOURCE_DIR}/opengl_02_config.h.in"
"${PROJECT_BINARY_DIR}/opengl_02_config.h"
)
#add the binary tree to the search path for include files
#so that it will find tutorialconfig.h
include_directories("{PROJECT_BINARY_DIR}")
add_executable(opengl_02_config opengl_02_config.cpp)
問題
爲什麼我的主文件沒有得到引用?
最後一點是我需要的。謝謝,+1 – zeboidlund 2011-12-25 05:40:34