Subj : Re: resource files To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Fri Nov 19 2004 08:28 pm The resource compiler only compiles resources. It cannot merge them into the exe because of a quirk in the Windows API (which says the NT line has a function that can replace resources but it doesn't). You must link your program to bind the resource file to the executable. > ...I don't know what to use for "startup" on the > command line ... I tried plugging "static run-time libraries" into the help index and it only came up with the 16 bit versions. Later compilers have help which shows the startup code names for 32 bits. startup code c0x32.obj console mode c0w32.obj gui mode libraries noeh32.lib stubs out exception handling and runtime type id for programs that do not use classes or new and delete import32.lib import library for what Windows provides cw32.lib single threaded runtime library cw32mt.lib multi threaded runtime library cw32i.lib single threaded runtime import library for when you are dynamic linked cw32mti.lib multi threaded runtime import library for when you are dynamic linked So, assuming Your program is a GUI program (graphical, starts at the function WinMain) Your program uses A.CPP and B.CPP You want the output to be C.EXE The resource file is D.RC D.RC uses E.RH and F.ICO A make file which would build C.EXE might look like the text between the dashed lines below. Note that anything on a line which follows a '#' is a comment, blank lines are ignored, a backslash is a line continuation character and what is indented versus what starts in column 1 is VERY important. -------------------- # the line below causes make.exe to handle the # C/C++ header file dependencies itself ..autodepend # macro below, '$(OBJ)' below becomes this list OBJS=a.obj b.obj # c.exe depends upon the list and upon d.res c.exe : $(OBJS) d.res import32 /Tpe/aa/Gn/x/c/v c0x32 $(OBJS),c,, \ import32 cw32,,d d.res : d.rc e.rh f.ico # what d.res depends on brcc32 d # command line to build d.res from d.rc ..cpp.obj : # how to make a *.obj from a *.cpp bcc32 -c -W -v $< # the '$<' above translates to the *.cpp name -------------------- For console mode: Replace c0w32 with c0x32 Replace -W with -WC Assuming that the make file is named 'BuildIt.MAK' then a command line to build the program would look like this: make -f buildit.mak (where the space following the '-f' and the extension '.mak' are optional) Using a make file is nice because it detects which items are newer than the target you are trying to build and doesn't rebuild those items which are already up to date. For example, if you changed only .. Ed >Jack Sawatzky wrote: >... >When I use the shell BCC32 everything functions well. >But it won't let me pass .res files to the linker. >When I try to use the linker separately, I don't know >what to use for "startup" on the command line. >I have never been able to use the linker separately, so >I can't link .res files. .