?
Solved

Problem with libraries...

Posted on 1999-01-04
2
Medium Priority
?
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

764 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