简体   繁体   中英

CPPUTest multiple defenition of main

Working on getting CPPUTest working with sample application code. I modified couple of make files to get this compiled but now I am facing linker error which states "multiple definition of `main'"

This is probably because I have one main in AllTests.cpp this is where we call CommandLineTestRunner::RunAllTests(ac, av) and another main is the main of my application code. Is there a way where this could be handled.

Create a library of the functions which you want to unit-test. Link this library to your unit-test application. Link the same library to your "main" application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM