![]() |
|
#1
|
|||
|
|||
Linking more than one objectHi,
Brief background...I am not a trained C programmer but am the poor soul left to update legacy C programs. One particular program requires use of BTRV API (instead of Scaleable SQL API) due to impending upgrade to Btrieve 8. The C compiler is Microsoft version 6.00A and the Linker is version 5.10. The procedure I use is to open a DOS window, run a batch file that sets up the path, includes, etc. and then run a batch file that does the compile and link. Firstly, I compile btrapi.c (compile only) to create btrapi.obj using this: cl -c /AM /Zp /Od btrapi.c This works fine, as far as I can tell, apart from three name truncation warning messages. Then I compile and link the application program. Originally, when just one object, I used this supplied batch file : cl -c /AM /Zp /Od xxxxxx.c link xxxxxx.obj, xxxxxx.exe,, xqlintf.lib, /ST:10240 /NOE [Note, I have masked the application name]. cl -c /AM /Zp /Od icrsex1a.c link xxxxxx.obj, btrapi.obj, xxxxxx.exe,, xqlintf.lib, /ST:10240 /NOE or cl -c /AM /Zp /Od icrsex1a.c link xxxxxx.obj btrapi.obj, xxxxxx.exe,, xqlintf.lib, /ST:10240 /NOE but get errors. I'll post the errors later, once I know and have tried the correct link method. Many Thanks.... |
|
#2
|
|||
|
|||
Re: Linking more than one objectQuote:
Using defaults (for compiler and linker options): 1. cl -c btrapi.c gives btrapi.obj 2. cl -c xxxxxx.c gives xxxxxx.obj 3. cl xxxxxx.obj btrapi.obj gives xxxxxx.exe (unless there are linker errors like undefined variables/functions or multiply defined variables, etc.) If you need extra linker options and libraries use /link on the cl command line, and you can pass them as follows: cl xxxxxx.obj btrapi.obj /link /STACK:10240 /NOENTRY I don't see why you couldn't use the link command by itself, but, depending on the version of link you have, it may not recognize "/ST" for "/STACK" and "/NOE" for "/NOENTRY". If I just enter "link" without any arguments it gives me a list of options. (Part of bewhiskered Visual Studio version 6.) Regards, Dave |
|
#3
|
|||
|
|||
Re: Linking more than one objectThanks Dave,
I'll try that out tomorrow as it's gone home time here! Cheers, Bob |
|
#4
|
|||
|
|||
Re: Linking more than one objectQuote:
If by /NOE, you meant /NOENTRY, What's up with that? Is the target file .exe or .dll? (Just curious.) Regards, Dave |
|
#5
|
|||
|
|||
Re: Linking more than one objectQuote:
/NOE means no extended dictionaries This prevents extended library searches which sometimes cause errors whilst linking |
|
#6
|
|||
|
|||
Re: Linking more than one objectOK, first try was
cl icrsex1a.obj btrapi.obj xqlintf.lib This gave me.... Microsoft (R) Segmented-Executable Linker Version 5.10 Copyright (C) Microsoft Corp 1984-1990. All rights reserved. Object Modules [.OBJ]: icrsex1a.obj + Object Modules [.OBJ]: "btrapi.obj" /farcall Run File [icrsex1a.exe]: "icrsex1a.exe" /noi List File [NUL.MAP]: NUL Libraries [.LIB]: "xqlintf.lib" Definitions File [NUL.DEF]: ; I think it may have worked! Will have to test program out now, will let you know. |
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use of HttpWebRequest object | dattaforit | .NET Forum | 1 | 08-Oct-2006 06:29 |
| Please Help Me To Build My Calendar!!! | suriacute85 | Java Forum | 0 | 05-Oct-2006 20:39 |
| overloading operators in a class. | fevershark | C++ Forum | 11 | 22-Feb-2006 20:34 |
| How do I access an object from inside another object? | JdS | MySQL / PHP Forum | 5 | 10-Jun-2003 09:51 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The