1

I download mingw complier with boost how it was there Setup Boost in Clion Then I started to test my lab and get multiple definition of `main', because my lab has main and C:/MinGw/include/boost/test/impl/unit_test_main.ipp: has main. If I commet all my main, tests succesfully passed And now i can't find solution for my problem.

  • A program can only have a single `main` function. What specifically is your problem? – Jesper Juhl Apr 03 '20 at 17:27
  • 1
    As @JesperJuhl said, there can be only one main() function in a program. If you want to unit-test what your program does move everything out of the main.cpp into a separate file/module/class, then you test it and call it from your main function. – Rene Apr 03 '20 at 17:34
  • Yes, I know. In unit-tests, boost while using file "unit_test_main.ipp", added main. We can see that in the end of file here https://www.boost.org/doc/libs/1_63_0/boost/test/impl/unit_test_main.ipp – Anton Gulyaev Apr 03 '20 at 17:36
  • Ok, I got it. I can add in cmakelists main.cpp or test-main.cpp. And now to complie twice to see how programm working and which tests passed or don't passed, Thank you – Anton Gulyaev Apr 03 '20 at 17:44

0 Answers0