User forums > Help
Compiling Dll and Lib in BCC
rickg22:
Um... try linking those particular files by hand - what we need is the format of the commandline used to invoke the compiler (or in this case, the linker). Try running "ilink32 /?" which will display a series of options. The trick is to modify the commandline in the settings so that it matches the one used by ilink32.
lymichri:
--- Quote from: jpattee on August 12, 2005, 04:59:00 pm ---Linker message for the static library follows. The problem is the 'o' in 'obj'. When I change this to something else, the unexpected char is always the first letter.
tlib.exe /C "lib\AStyle.lib" +obj\Astyle\src\ASCase.obj obj\Astyle\src\ASFormatter.obj obj\Astyle\src\ASResource.obj obj\Astyle\src\astyle_main.obj obj\Astyle\src\ASBeautifier.obj ,
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation
Error: unexpected char 'o' in command line
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 34 warnings
--- End quote ---
For static linking change the template in "Advanced compiler settings" from
$lib_linker /C $static_output +$link_objects,$def_output
to
$lib_linker /C /P512 $static_output /a $link_objects.
The original definition doesn't work because the "+" has to be prepended for each object.
The optional /P512 option for the page size can be omitted, if you don't need it.
jpattee:
Thanks to everyone for the response.
Something else has come up and it will probably be next week before I get back to this. But I will try the fix to the static library the first chance I get. I will post a reply of the results.
Meanwhile, if anyone knows a valid command line for linking a dll I would appreciate a response. This is the first time I have worked with Borland and I am not familiar with the compiler and linker options.
jpattee:
Here are the linker options that worked for me.
To link the static library, I changed the + to /a as per lymichri above. It worked. The settings I used for "Link object files to static library" are:
$lib_linker /C $static_output /a $link_objects,$def_output
A dynamic library uses the same link program as an executable, so the command line format has to be the same. I modified the executable command line by adding -Tpd and changing c0w32 to c0d32. The settings I used for "Link object files to dynamic library" are:
$linker -Tpd $link_options $libdirs c0d32 $link_objects, $exe_output,, $libs,, $link_resobjects
Navigation
[0] Message Index
[*] Previous page
Go to full version