Just show me how to link resources with bcc32...
Hi there!
It is no special topic, just write me a few lines, please!
I am working with the free Borland commandline compiler v5.5.
So far, I didn''t make use of resource-files, and I know that it is easy to do, but I just can''t figure out how... I am going crazy on that!
Something like
brcc32 data.rc main.exe produces the .RES file, shows no error message, but the .exe does not change (I tried to use a custom icon).
The resource-file and the usage of the resource in my source is definetely correct!
And ilink32 gives me
"data.res" contains invalid OMF record, type 0x00.
I searched the internet for help on this profound topic, but could not find anything!
Please give me the lines you would write to include resources!
Thank you very much,
zanturio
I recently had this EXACT problem. The problem is, BRC32.exe DOES NOT do what it was made to do. I went to an #winprog on an EFNET IRC server where I was told what was wrong. (and how to fix it.) You DO have to pass everything to ilink32, but you can't just pass it as an obj. You have to compile your program just to an obj, then compile your resource to a .res and pass it as well. I know that doesn't tell you much, but here is the exact commandlines I use to compile and link my resources. You can either use this to write a batch file, OR use this in a makefile. I've done both. Personally, I like using makefiles more. However, using it on the command line will work fine.
Here it is.
First compile your source files to .obj's...
bcc32 -c -W myfile.cpp
then compile your resource file...
brcc32 resource.rc
Here's the biggie. You need to pass EVERYTHING to the linker,
including libraries you may be using. EVERYTHING. I'll assume you're using direct draw just for tutorial purposes.
ilink32 -aa c0w32.obj myfile.obj,myfile.exe,,import32.lib cw32.lib ddraw.lib dxguid.lib,,resource.res
Yes, you need to include the commas on the command line. Don't know why, and I don't entirely understand everything on this command line, but there it is, and it works for me.
After the guy on IRC helped me, I felt like a total TARD 'cause I found what I was looking for in the help file that came with the compiler.
Here is exactly what came from the helpfile. (The exact commandline in the example.)
ILINK32 [@respfile][options] startup myobjs, [exe], [mapfile], [libraries], [deffile], [resfile]
If I helped, I'm glad. If not, you can contact me at Zerograv000@yahoo.com
Edited by - DracosX on March 4, 2001 3:06:23 AM
Here it is.
First compile your source files to .obj's...
bcc32 -c -W myfile.cpp
then compile your resource file...
brcc32 resource.rc
Here's the biggie. You need to pass EVERYTHING to the linker,
including libraries you may be using. EVERYTHING. I'll assume you're using direct draw just for tutorial purposes.
ilink32 -aa c0w32.obj myfile.obj,myfile.exe,,import32.lib cw32.lib ddraw.lib dxguid.lib,,resource.res
Yes, you need to include the commas on the command line. Don't know why, and I don't entirely understand everything on this command line, but there it is, and it works for me.
After the guy on IRC helped me, I felt like a total TARD 'cause I found what I was looking for in the help file that came with the compiler.
Here is exactly what came from the helpfile. (The exact commandline in the example.)
ILINK32 [@respfile][options] startup myobjs, [exe], [mapfile], [libraries], [deffile], [resfile]
If I helped, I'm glad. If not, you can contact me at Zerograv000@yahoo.com
Edited by - DracosX on March 4, 2001 3:06:23 AM
DracosX:Master of the General Protection Fault
Thank you very much, it works!
Perhaps I will even make use of quincy one day.
Perhaps I will even make use of quincy one day.
A little bit of extra info:
The command line I showed you only works on executables. In order to link a DLL with resources, there''s only 2 minor differences. Instead of c0w32.obj, use c0d32x.obj. For instance, a command line for a dll would be:
ilink32 -Tpd c0d32x MyDll.obj,MyDll.dll,,import32 cw32,,resource.res
It fits the same style, just replacing -aa with -Tpd and c0w32 with c0d32x. (I just ran into that problem last night) so I figured I''d reply to show you what obj file to link dlls with.
Also, I downloaded Quincy to see how well it worked. I couldn''t find it useful This is strictly opinion, but It is much easier for me to just do everything on the command line for now.
I am in the process of writing a Borland Free tools specific IDE so that setup won''t be quite as confusing as Quincy''s (which can also use Mingw) I''ve found the Borland compiler is the best free compiler for windows OR DOS programming.
Please no flaming, it is strictly opinion, and I have not yet tried every free compiler out there, so my opinion may still change.
The command line I showed you only works on executables. In order to link a DLL with resources, there''s only 2 minor differences. Instead of c0w32.obj, use c0d32x.obj. For instance, a command line for a dll would be:
ilink32 -Tpd c0d32x MyDll.obj,MyDll.dll,,import32 cw32,,resource.res
It fits the same style, just replacing -aa with -Tpd and c0w32 with c0d32x. (I just ran into that problem last night) so I figured I''d reply to show you what obj file to link dlls with.
Also, I downloaded Quincy to see how well it worked. I couldn''t find it useful This is strictly opinion, but It is much easier for me to just do everything on the command line for now.
I am in the process of writing a Borland Free tools specific IDE so that setup won''t be quite as confusing as Quincy''s (which can also use Mingw) I''ve found the Borland compiler is the best free compiler for windows OR DOS programming.
Please no flaming, it is strictly opinion, and I have not yet tried every free compiler out there, so my opinion may still change.
DracosX:Master of the General Protection Fault
March 07, 2001 07:07 AM
No flaming but the Borland compiler is for windows programming only. Mingw produces faster code and has asm+profiling support but pretty bad windows support. Borland has also other advantages and I think they are the two best free compilers.
March 08, 2001 01:17 AM
You might also want to try a nice text editor with syntax highlighting. I''ve tested "Editplus 2.01". It allows me to use external tools, so now I can write my code (with syntax highlighting), compile and run it from within "Editplus" ! There are also many free alternatives to it. It is a hell of a lot easier to work with some kind of an IDE....
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement