User forums > Using Code::Blocks

Codebocks on windows link 1561 error using clang

<< < (2/2)

pabristow:
Yes agreed - I found this on a well-known search engine too.

But I believe I do have a int main() in hello_boost_test

(provided by boost.test macro #define BOOST_TEST_MAIN )

and the same hello_boost_test.cpp source works fine with GCC.

so I suspect something in the Build Options is the cause, but remain puzzled.

BlueHazzard:

--- Quote ---so I suspect something in the Build Options is the cause, but remain puzzled.
--- End quote ---
and to fix this we need the signature of this main function

oBFusCATed:
What happens if you write manually main function? Does it work?

pabristow:
I'm not sure how to do this.  Boost.Test produces its own entry point with signature

int unit_test_main( init_unit_test_func init_func, int argc, char* argv[] );

and inspecting the result of --save-temp 

"J:\Cpp\hello_test\hello_boost_test.ii"

contains unit_test_main (as does the equivalent when compiling with gcc7.1.0).

I believe that Boost.test provides this as its version of main().  How this works interallyI have yet to understand.

(another test using another linked library works as expected).

stahta01:
You need to post your CB full re-build log to a site that supports the Boost Library.
You also need to post your Compiler, Linker, and Boost library version info on that site to get help.

Tim S.

Navigation

[0] Message Index

[*] Previous page

Go to full version