The problem seems to be the organization of your code modules. Supposed you have a c++ target project, that provides an executable program as it's final output:
- I suppose you want to create two executable artifacts
- your final application
- a test runner application that runs all test cases you have specified
- As for this should be your misconception, how to setup this scenario properly:
You cannot link functions from an executable artifact (the application) into another one (the test runner).
- You can either
- provide the core classes separate in a library and link it to your final application and the test runner. The application should provide a thin wrapper from the
main()
entry point.
- add links to the sources for the classes under test, and completely compile them in the test runner environment