When using Boost.Test, there is generally no need to define a main()
function, since Boost.Test provides one itself.
I recently had to convert my project to use static linking of 3rd party libraries (on VS2010). Naturally, I had to link to multiple .lib
s so that the build succeeds, and my build ran just fine.
However, when I ran my test project, something really strange happened. It seems that one of the 3rd party .lib
s (libpng), required by one of my dependent libraries, contained a test file with a main()
function defined within (pngtest.c
, if you must know).
Since my project did not have a main()
function, the linker chose that one as my "test" application. Thus, non of my tests run.
Does anyone know how I prevent this from happening? How can I tell the linker/compiler to use the Boost.Test main()
?