Feb 26, 2014 at 11:08pm UTC
Hi guys, facing some issues here:
Waz is in a DLL named Test
// Import/Export Pattern
#define DllExport __declspec(dllexport)
#define DllExport __declspec(dllimport)
class DllExport Waz
/* Friends */
friend class WazImpl;
friend Waz operator*(const Waz &,const Waz &);
#endif /* defined(__Test__Waz__) */
Waz operator*(const Waz &,const Waz &);
(all def of the operator in public and ...)
Waz operator*(const Waz & w1, const Waz & w2)
*ww.p=*w1.p * *w2.p;
Then in the solution I have a console application and in my main
a(1,1) =3 ; // this line works fine operator() is defined in the public of the Waz class
Waz c = a*b; // ERROR
error LNK2019 : unresolved external symbol "class Waz __cdecl operator*(class Waz const &, class Waz const &)" (??D@YA?AVWaz@@ABV0@0@Z) referenced in the function _main
error LNK1120 : 1 unresolved external symbol
Any idea? Don't know what to do anymore to solve this..
Thanks in advance!!
Feb 26, 2014 at 11:11pm UTC
Code tags can help us try to analyze code. Are you sure the operator is being exported?
Feb 26, 2014 at 11:19pm UTC
For sure class Waz is exported as I can put in my main Waz a; or use it's operator.
I think you might be right and my operator * is not exported but when I put in front of it DllExport (what I did to export the class) it gives me a new error :
error C2375 : operator* redefinition different linking