By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

Link to lib file

P: n/a
Hi

I'm pretty new to C++, and i'm using C++ Builder 6. I am including a
file with the line:

#include <engine.h>

I have added necessary Lib path in Project->Options Directories tab. I
have been told that I need to tell it to link to a secific .lib file
called libeng.lib which is in this lib path. How do I do this?

Thank you

Dec 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

wallacej wrote:
Hi

I'm pretty new to C++, and i'm using C++ Builder 6. I am including a
file with the line:

#include <engine.h>

I have added necessary Lib path in Project->Options Directories tab. I
have been told that I need to tell it to link to a secific .lib file
called libeng.lib which is in this lib path. How do I do this?

Thank you


That's not a C++ language question. It's a question about how to use
your compiler.

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Gavin Deane

Dec 20 '05 #2

P: n/a
On 20/12/2005, wallacej wrote:
I'm pretty new to C++, and i'm using C++ Builder 6. I am including a
file with the line:

#include <engine.h>

I have added necessary Lib path in Project->Options Directories tab.
I have been told that I need to tell it to link to a secific .lib file
called libeng.lib which is in this lib path. How do I do this?


I usually find it's easier to hand edit the .bpr project file than to
try to get the IDE to do this correctly. It's an XML file internally
and the format is pretty intuitive.

You might find that the folk over in borland.public.cppbuilder.* have
some better ideas. You'll need to point your newsreader at
newsgroups.borland.com to get these groups.

--
Simon Elliott http://www.ctsn.co.uk
Dec 20 '05 #3

P: n/a
Cheers guys

I've re-directed my query to the borland.public

Jamie

Dec 20 '05 #4

P: n/a
wallacej schrieb:
I'm pretty new to C++, and i'm using C++ Builder 6. I am including a
file with the line:

#include <engine.h>

I have added necessary Lib path in Project->Options Directories tab. I
have been told that I need to tell it to link to a secific .lib file
called libeng.lib which is in this lib path. How do I do this?


You will need something like:
#pragma link "libeng.lib"

Otherwise you will get a lot of unresolved external symbols.

B.

--
BM Computer-Services, Bergmannstr. 66, 10961 Berlin
Webdesign, Internet, Layout und Grafik
Tel.: 030/20649400, mobil 0175/7419517, Fax: 030/20649401
Web: http://www.bmservices.de, eMail: ko*****@bmservices.de
Dec 20 '05 #5

P: n/a
On 20/12/2005, Bernd Muent wrote:

You will need something like:
#pragma link "libeng.lib"

Otherwise you will get a lot of unresolved external symbols.


That's one way. The alternative is to make sure that you enter the lib
paths and then edit the .bpr file, adding or editing two parts:

in
<PROJECT>
<MACROS>

<LIBFILES value="mylib1.lib mylib2.lib"/>
in
<PROJECT>
<FILELIST>

<FILE FILENAME="mylib1.lib" FORMNAME="" UNITNAME="mylib1.lib"
CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/>

<FILE FILENAME="mylib2.lib" FORMNAME="" UNITNAME="mylib2.lib"
CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/>

If you do this, the linker will look for mylib1.lib and mylib2.lib on
the lib paths.

In theory you can enter the library names via IDE, using the project
manager, but I always find, when I do this, that the absolute paths of
the libraries are added in.

--
Simon Elliott http://www.ctsn.co.uk
Dec 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.