Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: onetimer needing help on __turboFloat and startup code


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Oct 16, 2015 9:58 AM Last Post By: Johan Dho Threads: [ Previous | Next ]
Johan Dho

Posts: 5
Registered: 11/15/15
onetimer needing help on __turboFloat and startup code  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 15, 2015 7:59 AM
Greetings,

I'm trying to revive a .dll that was created with Borland tools (full post on SO[1]). Apparently the Borland toolchain requires "startup code" to create a binary -- like c0d32.obj for a windows .dll. Where can i find documentation regarding this?
Thanks.

[1] http://stackoverflow.com/q/33149351/1831722
david hoke

Posts: 616
Registered: 2/9/07
Re: onetimer needing help on __turboFloat and startup code
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 15, 2015 9:15 AM   in response to: Johan Dho in response to: Johan Dho
Johan Dho wrote:

Greetings,

I'm trying to revive a .dll that was created with Borland tools (full
post on SO[1]). Apparently the Borland toolchain requires "startup
code" to create a binary -- like c0d32.obj for a windows .dll. Where
can i find documentation regarding this? Thanks.

[1] http://stackoverflow.com/q/33149351/1831722

Try also adding full paths to 'rtl' and 'vcl' .libs in the link command
line you're using and see if that helps.

Also, 'tdump' is the toolset utility for dumping a lot of things, think
it can be used to search the various libraries/dlls for the missing
definitions you have.
Johan Dho

Posts: 5
Registered: 11/15/15
Re: onetimer needing help on __turboFloat and startup code  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2015 3:20 AM   in response to: david hoke in response to: david hoke
david hoke wrote:
Johan Dho wrote:
Try also adding full paths to 'rtl' and 'vcl' .libs in the link command
line you're using and see if that helps.

Also, 'tdump' is the toolset utility for dumping a lot of things, think
it can be used to search the various libraries/dlls for the missing
definitions you have.

Thank you for your input.

Indeed the linker /L may be the issue.
I compiled with this line:

"C:\Program Files (x86)\Embarcadero\Studio\17.0\bin\bcc32.exe"
-q -w -tWM -tWD -y -vi- -v -a8 -r- -Od
-D_NO_VCL -D_MSC_VER=1200
-I"C:\Program Files (x86)\Embarcadero\Studio\17.0\include\windows\crtl"
-I"C:\Program Files (x86)\Embarcadero\Studio\17.0\include\windows\vcl"
-I"C:\Program Files (x86)\Embarcadero\Studio\17.0\include\windows\rtl"
-I"C:\Program Files (x86)\Embarcadero\Studio\17.0\include\windows\sdk"
-o obj\Debug\myProj.obj -c ..\myProj.cpp ..\subDir\file1.cpp ..\subDir\file2.cpp ...etc

and am trying to link with this line:

"C:\Program Files (x86)\Embarcadero\Studio\17.0\bin\ILINK32.EXE"
/aa /Tpd /x /Gn /Gi /q
/L
"C:\path\to\project;
C:\path\to\project\subDir;
C:\path\to\project\subDir\lib;
C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32c\debug;
C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32c\release;
C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32\debug;
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;
C:\MinGW\lib"
"C:\path\to\project\obj\Debug\myProj.obj"

yet according to the linker [documentation|http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devwin32/ilink32_xml.html] that's probably not how the linker expects it. It states specific libs but i want to add directories only, is that possible?
At least now it's down to complaining on common libs:

Error: Unresolved external '_isdigit' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_atol' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_strlen' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_strcat' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_sprintf' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_strcpy' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unable to perform link

which i thought should be in either win32?{debug|release} or MinGW\lib.

tdump does dump a lot, but nothing i could find useful (in the linux ldd sense at least).
Johan Dho

Posts: 5
Registered: 11/15/15
Re: onetimer needing help on __turboFloat and startup code  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2015 4:00 AM   in response to: Johan Dho in response to: Johan Dho
Johan Dho wrote:
At least now it's down to complaining on common libs:

Error: Unresolved external '_isdigit' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_atol' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_strlen' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_strcat' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_sprintf' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unresolved external '_strcpy' referenced from C:\path\to\project\obj\Debug\myProj.OBJ
Error: Unable to perform link

which i thought should be in either win32?{debug|release} or MinGW\lib.

tdump does dump a lot, but nothing i could find useful (in the linux ldd sense at least).

Which is code-related, not linker-related, there was a stray file with "WINAPI WinMain" when i'm building a .dll. So eventually Code::Blocks did output a link line:

ilink32.exe -q 
	-L"C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32c\debug" 
	-L"C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32\debug" 
	-LC:\MinGW\lib -Tpd /DEBUG  
	obj\Debug\myProj.obj obj\Debug\subDir\file1.obj obj\Debug\subDir\file2.obj obj\Debug\subDir\file3.obj,
	bin\Debug\target.dll,,
	"C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32\debug\vcl.lib" 
	"C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32\release\import32.lib" 
	"C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32\release\cw32mt.lib" 
	C:\path\to\proj\local.lib 
	C:\path\to\proj\subDir\otherLocal.lib 
	C:\path\to\proj\subDir\lib\yetAnother.lib,,

Fatal: Unable to open file 'SYSTEM.TYPINFO.OBJ',

which is nowhere on my disk.
Johan Dho

Posts: 5
Registered: 11/15/15
Re: onetimer needing help on __turboFloat and startup code  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2015 6:04 AM   in response to: Johan Dho in response to: Johan Dho
Johan Dho wrote:
Fatal: Unable to open file 'SYSTEM.TYPINFO.OBJ',

which is nowhere on my disk.

Not by that name at least, but vcl.lib and rtl.lib seem to help (by pointing directly at them). Now hunting for whichever has uniscribe.dfm.
david hoke

Posts: 616
Registered: 2/9/07
Re: onetimer needing help on __turboFloat and startup code  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2015 6:24 AM   in response to: Johan Dho in response to: Johan Dho
Johan Dho wrote:

Johan Dho wrote:
Fatal: Unable to open file 'SYSTEM.TYPINFO.OBJ',

which is nowhere on my disk.

Not by that name at least, but vcl.lib and rtl.lib seem to help (by
pointing directly at them). Now hunting for whichever has
uniscribe.dfm.

I expect that would be part of "your" project, as .dfm files are
delphi/builder form 'description' files...
Johan Dho

Posts: 5
Registered: 11/15/15
Re: onetimer needing help on __turboFloat and startup code  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2015 9:58 AM   in response to: david hoke in response to: david hoke
david hoke wrote:
I expect that would be part of "your" project, as .dfm files are
delphi/builder form 'description' files...

It is, they are. Got it to link into a .dll. The link line C::B produces is:
ilink32.exe -q 
  -L"C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32c\debug" 
  -L"C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32\debug" 
  -LC:\MinGW\lib -LC:\path\to\proj 
  -LC:\path\to\proj\subDir 
  -LC:\path\to\proj\subDir\lib 
  -Tpd /DEBUG  
  obj\Debug\subDir\filea.obj 
  obj\Debug\subDir\fileb.obj 
  obj\Debug\subDir\filec.obj 
  obj\Debug\subDir\filed.obj,bin\Debug\final.dll,,
  C:\path\to\proj\misc.lib C:\path\to\proj\subDir\otherMiscLib.lib 
  "C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32c\debug\cw32mti.lib" 
  "C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32c\debug\import32.lib",,

The -L and ,, get confusing. Now the program that uses the .dll crashes at runtime because some methos are missing, guess i over-trimmed the project but that's a local issue.

Thanks for the pointers.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02