Thread: Warnings that mess up the program...

  1. #1
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110

    Warnings that mess up the program...

    http://gametutorials.com/Tutorials/win32/Win32_Pg2.htm
    I used both the menu examples, and the borland compiler gave warnings on both of them, neither gives a menu.
    anyway a screenshot of the warnings

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Looks like just warnings of unused variables to me....

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    In C, just add the following before the function definition:

    #pragma argsused

    It'll disable the warning message.

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Or, you could just disable the warnings with the '-w' switch, ie:

    -w-8004 -w-8057
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    I think I might have to compile the .rc file with the cpp file, but I don't know how, I guess I mistiled the post, but the objective is to get the menu to function.

    Edit: I'm missing a afxres.h header file apparently, so I can't compile the .rc file
    Last edited by Dark Nemesis; 08-31-2003 at 10:04 AM.

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    you mean that you need a resource compiler?

  7. #7
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>you mean that you need a resource compiler?<<

    The borland command line tools come with a resource compiler (brcc32.exe).

    >>I'm missing a afxres.h header file apparently, so I can't compile the .rc file<<

    If you are using a resource script created by one of the various ms visual c++ ide's then you will have to manually edit the resource script to remove all the ms specific junk so that it can be compiled with bcc55 command line tools. You need #include <windows.h>, you'll need the specific resource definition statements (MENU etc) but all the afx junk should be removed.

    When it comes to compiling you also need to use the -c switch when compiling your source (cpp/c) file(s) so that objects are compiled but not linked.

    brcc32 your_script.rc will compile the resource script, your_script.rc to a *.res object. The final stage is to invoke the linker (ilink32.exe) to link the compiled source and the compiled resource(s) into the final executable.

    The reason that you need to do it this way is that you can't link resources into a built exe, despite the borland documents saying you can.

    There is an example of compiling resources with bcc55 cmd line on my wee humble web page (resources-->dialog box & controls) which should give you an idea of working with windows resources with the borland command line tools.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  8. #8
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    Ken Fitlike> I used you project example from the page you sugested and followed the directions in the readme, but when I run the program it can't find cow32.obj and deletes the .exe, any solutions? Borland kept giving errors with the tutorial files from gametutorials, and I couldn't compile. Line 10 (the language line) wasn't terminated correctly.

  9. #9
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Have you properly created your bcc32.cfg and ilink32.cfg configuration files as described here?
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  10. #10
    Spaced Cadet
    Join Date
    Aug 2003
    Posts
    110
    thank you, I had made a bcc32.cfg, but not an ilink.cfg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM