我正在使用
我尝试创建一个新目录并将其设置为root。 我的构造函数是:
BaseFile::BaseFile() {
name = "default";
}
Directory::Directory() {
parent = nullptr;
cout << "Directory: Default Constructor" << endl;
}
尝试使用FileSystem::FileSystem() {
root = new Directory();
}
我收到编译错误说:
/Applications/CLion.app/Contents/bin/cmake/bin/cmake --build /Users/adammorad/ver1/cmake-build-debug --target ver1 -- -j 2
Scanning dependencies of target ver1
[ 33%] Building CXX object CMakeFiles/ver1.dir/FileSystem.cpp.o
[ 66%] Linking CXX executable ver1
Undefined symbols for architecture x86_64:
"Directory::Directory()", referenced from:
FileSystem::FileSystem() in FileSystem.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [ver1] Error 1
make[2]: *** [CMakeFiles/ver1.dir/all] Error 2
make[1]: *** [CMakeFiles/ver1.dir/rule] Error 2
make: *** [ver1] Error 2