Solved

C++ Builder3 Linker Error

Posted on 2001-06-07
2
290 Views
Last Modified: 2012-08-13
To anyone willing to help,
I am trying to link advantech driver software to a data acquisition program I wrote using Borland C++builder3.
I have a PCL-812PG Multi-Lab card in my machine.

In my program I am able to include the header file "driver.h"
(#include"D:\Program Files\Advantech\ADSAPI\include\driver.h")

The error message reads as follows

[LinkerError] Unresolved external 'pcl818H(int,unsigned int*)' referenced from D:\PROGRAM FILES\BORLAND\CBUILDER3\PROJECTS\THESIS2.OBJ.

Thanks to jhance I have been able to eliminate suspicions of an exclude .LIB file by going in to 'Project Options' then 'Directories/Conditionals' then 'Library Paths' and specifying the path as follows:

D:\Program Files\Advantech\ADSAPI\Examples\BCB\LIB\ADSAPIBC.LIB

'pcl818H' is a function call to a parameter table the driver software uses. I declared at the end of the header file as follows:  extern pcl818H(int, unsigned int *);

This is fundamental stuff I know, but I have little experience in the field and this program is part
of my final year thesis to be presented on the 12th. So I'm pulling my hair out and would be very greatful
for any suggestions.
Thankyou,   (thanks to jhance for the help so far)
Richie.
0
Comment
Question by:RLawless
[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 86

Accepted Solution

by:
jkr earned 300 total points
ID: 6163531
You'll have to add a library that comes with the header file. The file itself just declares the functions that are used. the implementation resides in either a static lib file or a DLL that is bound to the project by a import lib. Both files end in .lib - see if you have it and add it to your project...
0
 
LVL 5

Expert Comment

by:pbhj
ID: 6163684
jkr seems to be on the ball:  perhaps you've done this already?  You need to  use the file->'add to project'  and select the .lib file from the pop-up menu.  This adds the required file to the project makefile, just using #include isn't enough

Hope this helps.

pbhj
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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

717 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