User forums > General (but related to Code::Blocks)

using a static librairie projetc in a console C++ project

(1/1)

zerimbak:
Hi all,

I'am using Code::blocks version 12.11 with OS windows XP 32 bits
I created a C static librairie with a single function : void test()

I made a C program which use le librairie (libtest.a) ,  the programme works very well.

And after that, I made a C++ program (the same with the same librairie - I linked it correctly )
but this program is not working, the compilation made an error : undefined reference to test()

Thanks for your help

jarod42:
unrelated to C::B

You may use extern "C" in your library header when linking with c++


zerimbak:
 Very good !! It's working !!
Thanks a lot.  :)

Navigation

[0] Message Index

Go to full version