Details:
I am trying to call a function defined in a .c file from a member function in .cpp file. But I am getting linking error as unresolved external symbol.
below are the details:
I am using Microsoft Visual Studio 2010. In my solution I have created 3 projects. Lets say Project1,Project2 & Project3. Out of this Project 2 & 3 are of Configuration type (Static library (.lib) ) and Project1 is of Configuration type Dynamic Library (.dll).
In Project2 I have foo.c
file in which I have defined a function return_type foo(args)
and I have declared it in foo.h
file.
In Project1 I have foo.cpp
file in which I have class with name cFooClass
which has one of the member function as cFooMemberFunction
. I am calling foo
(c Function) from this member function. For this I have added Project2.lib
and Project3.lib
libraries in the dependencies of Project1 and I have included foo.h
file(with extern "C") in foo.cpp
. But still I am getting error as unresolved external symbol.
Can anyone help me with this?