0

Hello friends,

I am facing a linking problem in VC++8.0 compiler.

Suppose I have a library, say A.dll.
In this library I have a file, say x.cpp. Within this file there is a extern const variable, like

.....
__declspec( dllexport ) extern const long ERROR = 100; 
.....

Now I am trying to access that constant from another library, say B.dll.

...
extern const long ERROR;
...
void ABC::func()
{
       std::cout<<ERROR;
}
...

Now whenever I am trying to build B.dll I am getting a linking error like
ABC.obj : error LNK2019: unresolved external symbol "long const ERROR" ....

I have already linked A.lib in the makefile to generate B.dll

Pls help me to fix the problem.

Thanx,
Amit

4
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by amt_muk
0

One more point I want to mention that it is running fine (obviously except __declspec( dllexport ) ) in Solaris environment with Sun Studio 10 compiler.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.