DLL exporting problem
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 ?
You are probably forgetting to add the lib reference for the DLL.
Look at this topic
http://www.cplusplus.com/forum/windows/44851/
Thanks, it work now :-)
Last edited on
Topic archived. No new replies allowed.