Can not Link on Windows (VS 2017)
Hello,
I can not integrate cmocka into an exsisting VS project. What I have done so far:
- Download repo and use cmake to build for VS2017
- Use VS2017 to open the .sln for one of the examples
- Built the example, this works without problems. This also generated the library files for cmocka.
- Copyed the cmocka.lib and cmocka.dll into my real project folder
- Included the header files of cmocka and the cmocka.lib
- The main function is replaced by the code from simple_example
It compiles but can not link. VS2017 throws an error LNK2019:
Error LNK2019 unresolved external symbol "int __cdecl _cmocka_run_group_tests(char const *,struct CMUnitTest const * const,unsigned int,int (__cdecl*)(void * *),int (__cdecl*)(void * *))" (?_cmocka_run_group_tests@@YAHPBDQBUCMUnitTest@@IP6AHPAPAX@Z3@Z) referenced in function _main SIM .\test_main.obj 1
It looks like the implementation of the method _cmocka_run_group_tests(...) can not be found. VS can definetly "see" the .lib file, if i remove it VS complains that it can not find the library file.
The settings of the project are almost identical to the simple_example project. Maybe someone has a hint, because I am out of ideas on what to do...