내 프로그램을 make
으로 컴파일하려고하면 주 오류에 대한 정의되지 않은 참조가 나타납니다. 그러나, 내 src 디렉토리 내에 main이 존재하며, 내가 잘못하고있는 것에 대해 잃어버린 느낌이 든다.CMake undefined reference to main
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