Hi, everyone,
Suppose the following simple program:
#include "engine.h"
int main()
{
Engine *ep;
if (!(ep = engOpen(NULL))) {
printf("Can't start MATLAB engine");
exit(-1);
}
engClose(ep);
return(0);
}
When I was trying to compile and link the program:
Linking...
engwindemo.obj : error LNK2001: unresolved external symbol _engClose
engwindemo.obj : error LNK2001: unresolved external symbol _engOpen
Debug/engwindemo.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
engwindemo.exe - 3 error(s), 0 warning(s)
Then I found "engClose" and "engOpen" are defined in "liben.def",
which in turn is directed to "libeng.dll" as indicated by the
following information.
LIBRARY libeng.dll
EXPORTS
_engClose=engClose
....
_engOpen=engOpen
....
_libeng_build_date=libeng_build_date
_libeng_version=libeng_version
I added all these two files into the project, but still the linking
error information appears. I wonder whether I have put the
"libeng.dll" into a wrong directory, that is, I should not add
"libeng.dll" into the project, but put it into some other proper
directory instead so that MS VC++ can find it when linking. Could
anyone give me some hints on this? Thanks a lot.
VB
/Cris