Command-line link error

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
meckles
Posts: 6
Joined: Mon 23 Jul 2007 22:21

Command-line link error

Post by meckles » Mon 23 Jul 2007 22:50

I just recently purchased SDAC 4 and it installed just fine and I can compile & link just fine in my IDE, C++ Builder 5 Pro. However, when I try to link from the command-line, I get a link error saying that couldn't open file DBCONSTS.OBJ. There is a DBCONSTS.DCU in the Cbuilder5\Lib\Obj, which I think is from the Dephi/Pascal compiler. If I add the .DCU to the linker input file, I get a fatal access violation during link.

Like I said, it builds just fine in the IDE, but due to the nature of the project I need to have it build from the command-line. What do I need to do to get it to link?

Thanks,
Marty

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 24 Jul 2007 14:21

The reason of the problem may be in wrong provided parameters to compiler, specifically missed paths to C++Builder's dcu files. Please show the command you are using to build your application.
Last edited by Antaeus on Wed 25 Jul 2007 09:20, edited 1 time in total.

meckles
Posts: 6
Joined: Mon 23 Jul 2007 22:21

Post by meckles » Tue 24 Jul 2007 14:26

I'm using the link command:
ilink32 @ptw_link.opt

The contents of ptw_link.opt are:
-aa -Tpe -GD -s -Gn -M -v -H:0xF00000 -S:0xF00000 +
-LY:\POLYWIN;V:\POLYTECH;D:\APRO +
-LD:\ABBREVIA\SOURCE;V:\DBLIB +
-LD:\CBuilder5\Sdac\Lib +
-LD:\CBuilder5\Lib\Obj +
C0W32.OBJ +
Y:\POLYWIN\POLYWIN.OBJ +
Y:\POLYWIN\CUSTmwe.OBJ, +
Z:\POLYWIN.EXE, +
Z:\POLYWIN.MAP, +
POLYWIN.LIB +
HTMLHELP.LIB +
IMPORT32.LIB +
RPCNS4.LIB +
W3BTRV7.LIB +
A306_D51.LIB +
B304_R51.LIB +
VCLX50.LIB +
VCL50.LIB +
MEMMGR.LIB +
CP32MT.LIB +
CW32MT.LIB,, +
Y:\POLYWIN\POLYWIN.RES

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 25 Jul 2007 09:28

Try to perform the following steps:
1) Create a new application from scratch.
2) Build this application from the command line.
3) Add the DB unit to the Uses clause, and build the application from the command line.
4) Add the MSAccess unit to the Uses clause, and build the application from the command line again.

Please inform us on what step you will encounter the problem with building.

meckles
Posts: 6
Joined: Mon 23 Jul 2007 22:21

Post by meckles » Wed 25 Jul 2007 13:42

I get the error when linking in "DB"

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 27 Jul 2007 06:51

This test shows that the reason is not in SDAC. Your linker for some reason cannot find files of your IDE. Probably they are missing, or there is something wrong with linker parameters.

meckles
Posts: 6
Joined: Mon 23 Jul 2007 22:21

Post by meckles » Fri 27 Jul 2007 14:32

Can you at least confirm that you are able to successfully able to compile and link from the command-line using C++ Builder 5 Pro?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 27 Jul 2007 15:07

We regularly build all our products from command line using compilers of different IDEs, including the C++Builder 5 Professional compiler.

meckles
Posts: 6
Joined: Mon 23 Jul 2007 22:21

Post by meckles » Fri 27 Jul 2007 16:51

I'm sorry, that statement is a little ambiguous. Do you mean that you build your components from the command-line, or projects that actually use them?

Can you tell me what setting you use for the linker, or how mine differ.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 30 Jul 2007 08:14

We use bpr2mak.exe and make.exe utilities to build our components. I'm not aware of your approach, but it seems to me that these lines are not correct in your options file:
-LD:\CBuilder5\Lib\Obj +
C0W32.OBJ +
Probably they should be changed with something like this:
-LD:\CBuilder5\lib\obj;D:\CBuilder5\lib
We recommend you to refer to resources dedicated to C++Builder (Borlands' forums, etc) for more information.

meckles
Posts: 6
Joined: Mon 23 Jul 2007 22:21

Post by meckles » Mon 30 Jul 2007 19:33

Thanks for your help.

For those interested, I figured out that VCLDB50.bpi needed to be added to the link.

Post Reply