[BCC 5.5] ilink32 problems

Started by
4 comments, last by Aardvajk 17 years, 12 months ago
Hello, [Plea] This plea for help is directed at experienced Borlanders who know the inside and out of the Borland Compiler and can give me insight as to why I fail miserably at code. [What I am Using] I am on a Windows XP machine and I am using Borland's Free Compiler. [Goal] To link objects together into an executable using ilink32 through command prompt. I would also like to achieve the same results with my make file. The reasoning behind this is so I gain the personal knowledge of knowing how to link files without that automated magic that IDE's provide. [Problem] The problem I am having is that I am obviously doing something wrong and when I get the resulting executable I want after linking it does not work. Here is my make file. [makefile] # --------------------------------------------------------------------------- PATHCPP = src\test.cpp CFLAGS1 = -c ExeFile = test.exe ObjectFiles = test.obj ResourceFile = # --------------------------------------------------------------------------- .autodepend BCC32 = bcc32 ILINK32 = ilink32 BRC32 = brc32 # --------------------------------------------------------------------------- test.cpp: $(BCC32) $(CFLAGS1) $(PATHCPP) # ILINK32 [@respfile][options] startup myobjs, [exe], [mapfile], [libraries], [deffile], [resfile] test.exe: test.obj ilink32 test.obj,test.exe,,import32.lib cw32.lib ,, # --------------------------------------------------------------------------- This is what I am compiling. A simple Hello World program. [test.cpp] #include <iostream> int main() { std::cout << "Hello World!" << std::endl; return 0; }; So when I run my makefile the .obj generates but no linking happens. I can manually enter this line into my command prompt: ilink32 test.obj,test.exe,,import32.lib cw32.lib ,, and it will generate teh .exe .map and all these other files. But when I run my executable is fails greatly. No errors will linking and compiling though. So is there anyone here who can set me straight?
Advertisement
I just use bcc32 to link and let it delegate to the linker how it wants, i.e.:
bcc32 -e"test.exe" test.obj import32.lib cw32.lib

Σnigma
I am aware of that you can link using bcc32 but I would like to know how using just ilink32.

If I wanted to generate a DLL would I not have to use ilink32 or can I generate it with bcc32? I have no interest in creating a dll but just a question.

If I were to use bcc32 to link other objects in later could use provide on an example as what I need to add to my makefile? Because so far my makefile does not work.
I'm working on my mac right now, so I can't tell you specifics -- but you -can- generate dlls from BCC32, it's just a switch. Also, re: problems with ilink32 -- what kinda run-time errors? Non-included lib stuff, or other nastier stuff?

~Shiny.
------------'C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg.' -Bjarne Stroustrup
When the executable begins it just tell me that is has encoutered a problem.

It is really a shot in the dark anwser here.

If someone were to test my code and post their resulting code that work I could compare my code to theirs to see what is wrong.
bcc32 will pass whatever it needs to ilink32. Whatever the problem with the program is, it is (almost certainly) not due to you not calling ilink32 directly. I am certain you can pass dlls and libs to bcc32 okay. It should say on the help screen.

I don't have my compiler to hand (I'm a borland free compiler nut too) but I'm pretty sure that bcc32 is not even the compiler either. I *THINK* it is a wrapper that literally just sorts out your arguements and passes them to the correct exe (ilink32, brcc32 and whatever the actual compiler is called).

Either way, bcc32 probably knows far more than us about invoking ilink.

BTW, my Borland make files look like this (no clever gubbins, works with any make)

OBJ = x.obj y.obj z.objx.exe : $(OBJ)    bcc32 $(OBJ)    rm x.tdsx.obj : x.cpp x.h // etc    bcc32 -c x.cpp// then same for y and z


I know it's long winded, but it works.

[Edited by - EasilyConfused on April 24, 2006 11:53:00 AM]

This topic is closed to new replies.

Advertisement