Solved

Problem with libraries...

Posted on 1999-01-04
2
172 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 100 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now