我从事C ++项目,我使用CMake构建文件。我的构建失败原因
对`Software :: Software()'的未定义引用
,但我看不到问题。如果您有想法,请不要犹豫,谢谢
文件体系结构:
CMake:
# cmake_minimum_required(VERSION <specify CMake version here>)
project(untitled)
cmake_minimum_required(VERSION 2.8.9)
set(CMAKE_CXX_STANDARD 11)
include_directories(include)
file(GLOB SOURCES "src/*.cpp")
add_executable(untitled ${SOURCES})
Software.h:
#include <string>
class Software{
private :
std::string name;
public :
Software();
}
Software.cpp:
#include "Software.h"
Software::Software() {
this->name = "defaultName";
}
SoftwaresConfigurations.h(称为软件的构造者):
#include "Software.h"
class SoftwaresConfigurations {
public:
SoftwaresConfigurations();
}
SoftwaresConfiguration.cpp:
#include "SoftwaresConfigurations.h"
SoftwaresConfigurations::SoftwaresConfigurations(){
Software software = Software();
}