How to handle this problem in MS VC++

From: Cris Ding (cris.ding_at_mh.se)
Date: 02/17/04


Date: 17 Feb 2004 12:53:01 -0800

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



Relevant Pages

  • Link Errors compiling a program in Visual C++ 2005...
    ... I'm compiling someone else's Open Source game from CVS in Visual ... C++ 2005 and I get linking issues. ... ServerWebHandler.obj: error LNK2001: unresolved external symbol ... Release/scorched.exe: fatal error LNK1120: 1 unresolved externals ...
    (microsoft.public.vstudio.general)
  • Re: Link Errors compiling a program in Visual C++ 2005...
    ... C++ 2005 and I get linking issues. ... ServerWebHandler.obj: error LNK2001: unresolved external symbol ... Release/scorched.exe: fatal error LNK1120: 1 unresolved externals ... The reason I think this is my fault is because I'm new to Visual Studio ...
    (microsoft.public.vstudio.general)
  • Re: how to build user test app which uses getpid()?
    ... Here is my current sources file and build messages. ... unresolved external symbol _getpid referenced in function _doWriter@8 ... error LNK1120: 1 unresolved externals ...
    (microsoft.public.development.device.drivers)
  • DIID_HTMLDocumentEvents2 Produces Linker Errors
    ... Linker gives the following errors: ... Linking... ... ToolBandObj.obj: error LNK2001: unresolved external symbol ... Debug/Test.dll: fatal error LNK1120: 1 unresolved externals ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • [Q] btdrt.lib linking error. in EVC
    ... I'm trying to write a very simple application in EVC 4.0 that uses ... I am including bt_api.h, and linking to btdrt.lib. ... compile the program I get the following linking errors; ... btdrt.lib: error LNK2019: unresolved external symbol ...
    (microsoft.public.windowsce.platbuilder)