Unity的链接器错误(C单元测试框架)
我在Stackoverflow中尝试将Unity单元测试框架()链接并构建在CMAKE上,以便编写单元测试,但我一直遇到相同的错误:Unity的链接器错误(C单元测试框架),c,unit-testing,cmake,unity-test-framework,C,Unit Testing,Cmake,Unity Test Framework,我在Stackoverflow中尝试将Unity单元测试框架()链接并构建在CMAKE上,以便编写单元测试,但我一直遇到相同的错误: Undefined symbols for architecture x86_64: "_setUp", referenced from: _UnityDefaultTestRun in libunity.a(unity.c.o) "_tearDown", referenced from: _UnityDefaultTestRun
Undefined symbols for architecture x86_64:
"_setUp", referenced from:
_UnityDefaultTestRun in libunity.a(unity.c.o)
"_tearDown", referenced from:
_UnityDefaultTestRun in libunity.a(unity.c.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[2]: *** [bin/test_problem2_59.exe] Error 1
make[1]: *** [tests/CMakeFiles/test_problem2_59.exe.dir/al
我在这里记录了我的最后一次尝试,最新的提交是不稳定提交。我不确定我在computer_systems/tests/CMakeLists.txt中还缺少了什么来让它工作。只是想寻求一些指导,也许是我在这里遗漏的一个解释。关于如何更好地构建我的文件夹结构的指导也很有帮助。只需添加名为
setUp
和teadDown
的空函数即可