?
Solved

Problem with libraries...

Posted on 1999-01-04
2
Medium Priority
?
230 Views
Last Modified: 2010-04-02
I am implementing some C++ program compiles to a DLL. Within this program I call a function from some library, which I specified the compiler to link to. However, I keep getting this error message during compile time:

Kermit.obj : error LNK2001: unresolved external symbol "int __cdecl broker(struct ETBCB *,char *,char *,char *)" (?broker@@YAHPAUETBCB@@PAD11@Z)

I am using Visual C++ 6.0 and created the project using the Win32 Dynamic Link Library project wizard as an empty project.

I checked and double-checked everything from environment variables, to case sensitivity etc. But it seems as if the problem is related to calling the broker() function, which is ?supposed? to reside in the broker32.lib, which I told the compiler to point to as a library.

Any ideas?
0
Comment
Question by:loyaliser
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 400 total points
ID: 1181505
You should use C linkage when you declare the broker function as follows.

extern "C" int broker(struct ETBCB *,char *,char *,char *);

or

extern "C"
{
#include "broker.h"
}

0
 
LVL 1

Author Comment

by:loyaliser
ID: 1181506
Thank you...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question