Board index » cppbuilder » How do I add a lib to project in BDS2006?

How do I add a lib to project in BDS2006?


2007-05-09 10:50:33 AM
cppbuilder101
Actually, I don't remember how I did it in BCB6, either.
I'm trying to add Codebase library c4lib.lib to my project (statically
linked). Here's the code (simple test app):
#include <vcl.h>
#pragma hdrstop
#include "MainFrm.h"
#include "d4all.hpp" // CodeBase
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "JvButtons"
#pragma link "JvExButtons"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::JvHTButton1Click(TObject *Sender)
{
Code4 t_codeBase; // access violation right here
Data4 t_data_age;
String t_file = "AGE.DBF";
t_data_age.open(t_codeBase, t_file.c_str());
try {
if (t_data_age.isValid())
{
MessageDlg("Age.dbf is open",
mtInformation, TMsgDlgButtons() << mbOK, 0);
}
} __finally {
t_data_age.close();
t_codeBase.initUndo();
}
}
//---------------------------------------------------------------------------
Library search path contains:
$(BDS)\..\..\codebase\lib\sa\borb5
$(BDS)\lib\debug
plus inherited values from lower level settings
I *think* the problem has to do with adding the lib to my project. Help!
Thanks,
Kathleen
 
 

Re:How do I add a lib to project in BDS2006?

"Kathleen Beaumont" < XXXX@XXXXX.COM >wrote in message
Quote
Actually, I don't remember how I did it in BCB6, either.
Use the "Add to Project" menu item, or use the Project Manager.
Gambit
 

Re:How do I add a lib to project in BDS2006?

Remy Lebeau (TeamB) wrote:
Quote
"Kathleen Beaumont" < XXXX@XXXXX.COM >wrote in message
news:464136f5$ XXXX@XXXXX.COM ...

>Actually, I don't remember how I did it in BCB6, either.

Use the "Add to Project" menu item, or use the Project Manager.


Gambit


Remy,
When I do this in BCB6, my test app compiles, links and runs, and a
button click event opens and closes a DBF file using Codebase.
When I do this in BDS2006, a page opens in the IDE displaying the lib as
text. The project compiles, links and runs, but the button click raises
an exception on the first line that references a Codebase object.
Does the Codebase lib have to be created specifically for BDS2006?
Thanks for your help,
Kathleen
 

{smallsort}

Re:How do I add a lib to project in BDS2006?

On Tue, 08 May 2007 19:50:33 -0700, Kathleen Beaumont
< XXXX@XXXXX.COM >wrote:
Quote
I'm trying to add Codebase library c4lib.lib to my project (statically
linked). Here's the code (simple test app):
#pragma comment(lib,"c4lib.lib")
--
Vladimir Ulchenko aka vavan
 

Re:How do I add a lib to project in BDS2006?

vavan wrote:
Quote
On Tue, 08 May 2007 19:50:33 -0700, Kathleen Beaumont
< XXXX@XXXXX.COM >wrote:

>I'm trying to add Codebase library c4lib.lib to my project (statically
>linked). Here's the code (simple test app):

#pragma comment(lib,"c4lib.lib")

Thanks, vavan, but still no joy.
As I mentioned to Gambit, adding the Codebase library to my project let
me build and run, but the application throws an access violation on the
first line of code that references an object in the Codebase library.
Building this same app in BCB6 builds and runs without error.
So am I missing something fundamental here, such as "You can't use the
Codebase library that works with BCB5 and BCB6 with BDS2006"? Note that
this is just the library of functions; it is not the Codebase components.
Thanks for your help.
Kathleen
 

Re:How do I add a lib to project in BDS2006?

On Thu, 10 May 2007 05:06:00 -0700, Kathleen Beaumont
< XXXX@XXXXX.COM >wrote:
Quote
Thanks, vavan, but still no joy.

As I mentioned to Gambit, adding the Codebase library to my project let
well, I only answered how to link arbitrary lib to your project
Quote
me build and run, but the application throws an access violation on the
first line of code that references an object in the Codebase library.
since I never used codebase I can only speculate here. perhaps some
aligning issues?
Quote
Building this same app in BCB6 builds and runs without error.
do you mean you only have single lib file for different bcb versions?
Quote
So am I missing something fundamental here, such as "You can't use the
Codebase library that works with BCB5 and BCB6 with BDS2006"? Note that
this is just the library of functions; it is not the Codebase components.
if you had the sources of aforementioned lib you could simply rebuilt
it for bcb2006. beware of alignment and enum sizes
--
Vladimir Ulchenko aka vavan
 

Re:How do I add a lib to project in BDS2006?

vavan wrote:
Quote
>Building this same app in BCB6 builds and runs without error.

do you mean you only have single lib file for different bcb versions?
Yes. It's a third party library, and the vendor does not post a BDS2006
version. The version I have been using with BCB6 was prepared for BCB5.
It works fine.
Quote
>So am I missing something fundamental here, such as "You can't use the
>Codebase library that works with BCB5 and BCB6 with BDS2006"? Note that
>this is just the library of functions; it is not the Codebase components.


if you had the sources of aforementioned lib you could simply rebuilt
it for bcb2006. beware of alignment and enum sizes

Okay, so if I'm reading your message correctly, then I'm out of luck
until and unless the vendor prepares a BDS version. (Please tell me if
that interpretation is wrong!)
Thanks so much for your help!
Kathleen
 

Re:How do I add a lib to project in BDS2006?

Hi,
Quote
>it for bcb2006. beware of alignment and enum sizes
Okay, so if I'm reading your message correctly, then I'm out of luck
Not with regard to those switches. You can
check in Project Options for those (compare
your BCB6 to BDS2006). But I'd recommend
showing the command line: In BDS2006 turn
ON Tools | Options | Environment Options
| Show Comnmand line. In BCB6, add this
reg entry:
[HKEY_CURRENT_USER\Software\Borland\C++Builder\6.0\Compiling]
"ShowCommandLine"="True"
Then compare all the switches. (you can copy the
lines into notepad.exe to make that easier).
Something else might pop out but especially check -b
(enum size), -a (alignment) and -k (standard stack frames).
BTW, I have used .OBJ's from earlier versions successfully
when it was simple C style functions.
--Craig
 

Re:How do I add a lib to project in BDS2006?

Quote
>"Kathleen Beaumont" < XXXX@XXXXX.COM >wrote in message
>news:464136f5$ XXXX@XXXXX.COM ...

Does the Codebase lib have to be created specifically for BDS2006?

Kathleen,
It's been a long time since my last use of Codebase (version 4 at that
time),
but AFAIR it ships with source code that let's you rebuild the lib.
Check Sequiter's web site for more info
Meanwhile i've cheked the site and they refer C++Builder 2006 support.
HTH
Antonio
Quote
Thanks for your help,

Kathleen

 

Re:How do I add a lib to project in BDS2006?

On Thu, 10 May 2007 06:40:10 -0700, Kathleen
< XXXX@XXXXX.COM >wrote:
Quote
Okay, so if I'm reading your message correctly, then I'm out of luck
until and unless the vendor prepares a BDS version. (Please tell me if
that interpretation is wrong!)
first of all try to rebuild your own app with -b option
--
Vladimir Ulchenko aka vavan
 

Re:How do I add a lib to project in BDS2006?

Craig, Antonio, vavan:
Thank you all for helping me. Unfortunately, nothing I tried (and I
tried everything you all suggested) has changed my outcome.
I'm going to post new questions on another thread (because this one
suffers from old age).
BTW, I have BCB6 installed on two computers (two licenses). The one at
work includes the reg entry Craig mentioned:
Quote
In BCB6, add this
reg entry:
[HKEY_CURRENT_USER\Software\Borland\C++Builder\6.0\Compiling]
"ShowCommandLine"="True"
However, my laptop at home does not have a Compiling folder down the
C++Builder\6.0 path, and there is no mention of "ShowCommandLine"
anywhere in my registry.
I mention this mostly to say that it is the little things that are
making me absolutely insane.
Anyway, thank you again for the help... even if I am not yet solving my
specific problem, I'm learning things I didn't know.
Kathleen
 

Re:How do I add a lib to project in BDS2006?

Antonio Felix wrote:
Quote
Check Sequiter's web site for more info

Meanwhile i've cheked the site and they refer C++Builder 2006 support.

HTH
Antonio
Antonio,
Can you provide a link to the page where you saw this? I looked here:
www.codebase.com/products/windows/
and all I see under "Compilers Supported" is C++ Builder (no version
number).
(I'll have my boss call Sequiter this week to find out if they have a
BDS2006 version available; our license limits who among us is permitted
to annoy the support staff at Sequiter.)
Thanks,
Kathleen
 

Re:How do I add a lib to project in BDS2006?

Quote

Can you provide a link to the page where you saw this? I looked here:

Hi Kathleen,
It was on the 3rd Party Tools for Codebase, in the
Vcl components
www.codebase.com/products/3rdparty/sandage/cbcomps4/
<Quote>
Specifications:
Versions for Delphi 5, 6, 7, 2005 (Win32), 2006 and C++ Builder 5, 6, 2006 included.
</Quote>
So they must supply a Lib version for BDS also.
HTH
Antonio
 

Re:How do I add a lib to project in BDS2006?

This is good news! We're not using the components, just the library of
functions, but this may make the difference.
Thank you, Antonio.
Kathleen
Antonio Felix wrote:
Quote
>Can you provide a link to the page where you saw this? I looked here:
>


Hi Kathleen,

It was on the 3rd Party Tools for Codebase, in the
Vcl components

www.codebase.com/products/3rdparty/sandage/cbcomps4/

<Quote>
Specifications:
Versions for Delphi 5, 6, 7, 2005 (Win32), 2006 and C++ Builder 5, 6, 2006 included.
</Quote>

So they must supply a Lib version for BDS also.

HTH
Antonio