473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to handle this problem in MS VC++

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
Nov 14 '05 #1
2 2426
Cris Ding <cr*******@mh.se> scribbled the following:
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.


You'll want to link the "libeng.dll" library. How to do this is none
of comp.lang.c's business, as it's specific to MSVC++.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"To doo bee doo bee doo."
- Frank Sinatra
Nov 14 '05 #2
On 17 Feb 2004 12:53:01 -0800, in comp.lang.c , cr*******@mh.se (Cris Ding)
wrote:
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.


This would be a Windows question. You need to ask it over there.

(by the way the function's runtime code may be in the DLL but you still
need a .lib file to link with, unless you're doing /real/ dynamic loading,
which you're not. The .lib contains the stub loader for the DLL code).
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter Schmitz | last post by:
Hi, I've got the following problem: My current project consists of several clients and all of them use(read) a file, that is placed on a shared hard disk on one of my file servers (windows2k)....
0
by: news.microsoft.com | last post by:
In VC 6.0 I can use class wizard to handle toolbar event. but I can't find how it can be handled in VC.net. that make me upset. :( have a nice day.
7
by: Ioannis Vranos | last post by:
I have been checking C++/CLI lately by using VC++ 2005 Express Beta 1 (should be called Alpha though). In managed extensions we could pass managed pointers to functions taking unmanaged pointers...
4
by: LhK-Soft | last post by:
Hi, I'm active in VC++ for several years now, so I know some things (I think). Using MS-Access I store a db with lots of entries and uses the VBA techniques to export those data to e.g. HTML, XML...
17
by: Fred Hebert | last post by:
I am trying to use a 3rd party DLL that requires the main window handle as a parameter. e.g. MyFunc(WHND MyHandle); The example looks something like this: Result = MyFunc(Handle); Where...
7
by: Ken Varn | last post by:
I am working in managed C++. I have a Mutex object in which I need to replace the Handle property with a new handle. The new handle is being constructed using Win32 CreateMutex call. I need to...
8
by: Shawn B. | last post by:
Greetings, Me again. I have (roughly) the following code: HANDLE hConsoleOutput; HANDLE hConsoleInput;
10
by: Dancefire | last post by:
Hi, everyone, I'm writing a program using wstring(wchar_t) as internal string. The problem is raised when I convert the multibyte char set string with different encoding to wstring(which is...
3
by: bhumithakker | last post by:
I am using a DLL function (complied in VC7), which takes a parameter of 'HANDLE *' datatype. The DLL developers recommend passing a HANDLE object using the following syntax: HANDLE obj =NULL;...
4
by: Donos | last post by:
Hi I have a HANDLE to an Event, like this.. HANDLE h = ::CreateEvent(NULL, FALSE, FALSE, NULL); This is running in one thread in one class. For example we will call that class as "Class A"...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.