DLL exporting problem
May 12, 2013 at 7:04pm
Hello guys,I have problem with exporting a non-class function from dll.
1 2 3 4 5 6 7 8 9 10
|
//dll project
namespace DLL
{
class DLLclass
{
void somefunction();
}
}
|
1 2 3 4 5 6 7
|
//EXE project
int main()
{
DLL::DLLclass Dclass;
Dclass.somefunction();
}
|
this works perfectly, but when I want some non-class function
1 2 3 4 5
|
//DLL project
namespace DLL
{
void somefunction();//definition of function is in .cpp file
}
|
1 2 3 4 5
|
//EXE project
int main()
{
DLL::somefunction();
}
|
I getting this errors:
main.obj : error LNK2001: unresolved external symbol "void __cdecl DLL::somefunction()"....
|
Any ideas ?
May 13, 2013 at 1:13pm
You are probably forgetting to add the lib reference for the DLL.
Look at this topic
http://www.cplusplus.com/forum/windows/44851/
May 13, 2013 at 9:21pm
Thanks, it work now :-)
Last edited on May 13, 2013 at 9:22pm
Topic archived. No new replies allowed.