|
From: Eduardo G. <egi...@ca...> - 2003-01-29 05:15:19
|
I made the next programs:
=20
T1.h:
-------
class mc {
public:
int i;
int mostrar();
};
=20
t1.cpp
--------
#include "t1.h"
int mc::mostrar()
{
i =3D 8;
return i;
}
=20
pgm9.cpp
------------
#include <iostream>
#include "t1.h"
using namespace std;
mc m;
int main()
{
cout << m.mostrar();
return 1;
}
=20
I converted t1.cpp to t1.dll using:
gcc -shared -o t1.dll t1.cpp -Wl,--output-def,t1.def,--out-implib =
,libt1.a
and compiled with pgm9.cpp. The object runs without problems.
=20
According to mingw FAQ I wanted to invoque t1.dll from a MSVC 6.0, so I =
did the next:
lib /machine:i386 /def: t1.defcl
From MSVC I compiled well, I included t1.lib in the linking options. =
When linking, I get the next error:
Linking...
pt1Dlg.obj : error LNK2001: unresolved external symbol "public: int =
__thiscall mc::mostrar(void)" (?mostrar@mc@@QAEHXZ)
Release/pt1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Does anybody experienced this? How can I solve it?=20
Regards !!
=20
|