Board index » cppbuilder » Linking a Hello Program

Linking a Hello Program


2005-05-26 11:19:14 PM
cppbuilder29
I am new to BC++5.5.1. I can create, compile and run a hello program using
bcc32. I am now trying to use a makefile to first compile (-c option) and
then, as a separate operation, link (using ilink32). The compilation works,
and a hello.exe file is created by ilink32. But the hello.exe when executed
produces a window that says hello.exe is not a valid win32 application. I
tried -ap and -Tpe with ilink32 with no success. The hello.exe are always
about 2K in size while the bcc32 created version that runs is about 130K.
What am I doing wrong? Are there other .obj or .lib files that need to be
included in the link?
I cannot understand why ilink32 would not default to the same behavior as
when it is invoked automatically by bcc32.
Thanks for any help.
Randy
 
 

Re:Linking a Hello Program

I found at edmulroy.portbridge.com/howto.htm the suggestion to use:
bcc32 -c -WC hello
ilink32 /Tpe/ap/Gn/x/c c0x32 hello,hello,,import32 cw32i
The resulting hello.exe is 7k now but still does not execute. Now I get a
series of three Windows with the message:
"hello.exe has encountered a problem and needs to close"
Removing -WC from the compiler line made no difference.
Any other ideas?
Randy
 

Re:Linking a Hello Program

"Randy Stonesifer" < XXXX@XXXXX.COM >writes:
Quote
I am new to BC++5.5.1.
Welcome then.
The compiler that identifies itself as Borland C++ 5.5.1 is in fact
the compiler of C++ Builder 5.
Please direct your browser at info.borland.com/newsgroups/ and
read the newsgroup descriptions and guidelines. This will help you
find the appropriate newsgroup for your question.
C++ Builder groups have .cppbuilder. in their name.
 

{smallsort}

Re:Linking a Hello Program

I am new to BC++5.5.1 (command line tools). I can create, compile and run a
hello program using bcc32. I am now trying to use a makefile to first
compile (-c option) and then, as a separate operation, link (using ilink32).
The compilation works, and a hello.exe file is created by ilink32. But the
hello.exe when executed produces a window that says hello.exe is not a valid
win32 application. The hello.exe is only 2k compared to the 113k version
that was created without separate linking and works.
I found at edmulroy.portbridge.com/howto.htm the suggestion to use:
bcc32 -c -WC hello
ilink32 /Tpe/ap/Gn/x/c c0x32 hello,hello,,import32 cw32i
The resulting hello.exe is now 7k instead of 2k but still does not execute.
Now I get a series of three windows with the message:
"hello.exe has encountered a problem and needs to close"
Removing -WC from the compiler line made no difference.
Any other ideas?
Where can I find documentation on the c0x32, cw32i, etc. files that are
provided?
Randy
 

Re:Linking a Hello Program

With the help of the makefile generator at
www.leunen.com/App/mfgen.html I found that the following makefile
works:
hello.exe : hello.obj
ilink32 /Tpe/ap/Gn/x c0x32 hello,hello,,import32 cw32
hello.obj : hello.cpp
bcc32 -c hello.cpp
The difference is the cw32 instead of cw32i.
The mfgen tool is nice!
Any one know what these files are for and where they are documented?
Randy
 

Re:Linking a Hello Program

Hi Randy,
Randy Stonesifer wrote:
Quote

The mfgen tool is nice!
Thanks. Glad it's of some help for you.
Quote

Any one know what these files are for and where they are documented?
c0d32.obj DLL startup module
c0d32w.obj DLL startup module, Wide-char version
c0d32x.obj DLL startup module, no exception handling
c0pkg32.obj Package startup module
c0w32.obj GUI EXE startup module
c0w32w.obj GUI EXE startup module, Wide-char version
c0x32.obj 32-bit console-mode EXE startup module
c0x32w.obj 32-bit console-mode EXE startup module, Wide-char version
cp32mt.lib VCL-compliant C RTL multithreaded static library
cp32mti.lib VCL-compliant import library for multithreaded C RTL
cp3250mt.dll
cw32.lib RTL single-threaded static library
cw32i.lib Import library for RTL cw3250.dll
cw32mt.lib RTL multi-threaded static library
cw32mti.lib Import library for multithreaded RTL cw3250mt.dll
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

Re:Linking a Hello Program

Quote
Any one know what these files are for and where they are documented?
They are documented in the compiler's help file.
Start the help
Click on the Index tab
Type Static Runtime Libraries into the edit control
Click the Display button
If you do not have help that provides the implication is that
you have not downloaded those help files. Look here for them:
info.borland.com/techpubs/bcppbuilder/v5/updates/pro.html
. Ed
Quote
Randy Stonesifer wrote in message
news: XXXX@XXXXX.COM ...