Page 1 of 1
Command-line link error
Posted: Mon 23 Jul 2007 22:50
by meckles
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
Posted: Tue 24 Jul 2007 14:21
by Antaeus
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.
Posted: Tue 24 Jul 2007 14:26
by meckles
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
Posted: Wed 25 Jul 2007 09:28
by Antaeus
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.
Posted: Wed 25 Jul 2007 13:42
by meckles
I get the error when linking in "DB"
Posted: Fri 27 Jul 2007 06:51
by Antaeus
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.
Posted: Fri 27 Jul 2007 14:32
by meckles
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?
Posted: Fri 27 Jul 2007 15:07
by Antaeus
We regularly build all our products from command line using compilers of different IDEs, including the C++Builder 5 Professional compiler.
Posted: Fri 27 Jul 2007 16:51
by meckles
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.
Posted: Mon 30 Jul 2007 08:14
by Antaeus
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.
Posted: Mon 30 Jul 2007 19:33
by meckles
Thanks for your help.
For those interested, I figured out that VCLDB50.bpi needed to be added to the link.