Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: zerimbak on February 13, 2013, 05:35:24 pm

Title: using a static librairie projetc in a console C++ project
Post by: zerimbak on February 13, 2013, 05:35:24 pm
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
Title: Re: using a static librairie projetc in a console C++ project
Post by: jarod42 on February 13, 2013, 06:39:08 pm
unrelated to C::B

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


Title: Re: using a static librairie projetc in a console C++ project
Post by: zerimbak on February 13, 2013, 07:37:57 pm
 Very good !! It's working !!
Thanks a lot.  :)