Hi All!
I am converting a "C" file to a C++ file for a project.
The file uses external functions definitions from a shared library(dll) which is built with C linkage. So when I converted this file to C++ I set the function declarations of these functions as extern "C". That is all fine, but there is a global data called "pdb_object *open_object" which is exported by the above dll. This is defined in a global file calld "pdb.glb". I have included this file
also with extern "C".
extern "C"
{
#include <pdb.glb>
}
and
#define DLLIMP __declspec(dllimport)
extern "C" DLLIMP pdb_object* open_object;
But what is happening is that, at build time the compiler is not able to resolve this global definition and gives an error.
Deneb2CgrMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct pdb_object * open_object" (__imp_?open_object@@3PAUpdb_object@@A)
What is peculiar is that it is able to resolve most other data members imported from the dll similarly...
I did a dumpbin on the dll and I am able to see the definition for this particular symbol...
Thanks
Anand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mail me at abpillai@excite.com if you want additional help. I dont promise that I can solve your problem, but I will try my best.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am converting a "C" file to a C++ file for a project.
The file uses external functions definitions from a shared library(dll) which is built with C linkage. So when I converted this file to C++ I set the function declarations of these functions as extern "C". That is all fine, but there is a global data called "pdb_object *open_object" which is exported by the above dll. This is defined in a global file calld "pdb.glb". I have included this file
also with extern "C".
extern "C"
{
#include <pdb.glb>
}
and
#define DLLIMP __declspec(dllimport)
extern "C" DLLIMP pdb_object* open_object;
But what is happening is that, at build time the compiler is not able to resolve this global definition and gives an error.
Deneb2CgrMain.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct pdb_object * open_object" (__imp_?open_object@@3PAUpdb_object@@A)
What is peculiar is that it is able to resolve most other data members imported from the dll similarly...
I did a dumpbin on the dll and I am able to see the definition for this particular symbol...
Thanks
Anand
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mail me at abpillai@excite.com if you want additional help. I dont promise that I can solve your problem, but I will try my best.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~