Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: amit1947 on December 04, 2008, 08:23:22 pm
-
Hi everyone, I'm just getting started with Code::Blocks but I have some issues. I created a static library with C (.a extension) and I want to call these functions within another C++ project. When I try to build the C++ project I get an error in the Build Log : "undefined reference to 'HwOpen()' ". HwOpen() is a function in the static library.
I went into the C++ Project's build options and selected the correct lib.a file in the "Linker Settings" tab.
I know this process worked when I called the static library functions from a C project, but I think I need to do something else for the C++ project.
Thanks for any help!
-
I forgot to mention that I'm using Code::Blocks in Ubuntu Linux.
-
Hi,
search the web for "extern c"
Dje
-
Thanks for the help! That did it , I added
extern "C"{
function_prototypes();
}
to the C lib's header file and it works now.