Thread: 32-bit binary resource saved as a 16-bit program

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    932

    32-bit binary resource saved as a 16-bit program

    I compiled calc.exe 32-bit with with the resource compiler rc.exe in command line, on Windows 10 with VS 2017.

    When I try to execute it, after loading the resource and writing it to a file, I get the:
    "Unsupported 16-bit Application"
    "The program or feature cannot start or run due to incompatibility with 64-bit versions of Windows."
    error dialog.

    I tried to compile it as 64-bit but gave me the same result.

    What could be the problem?
    Last edited by Ducky; 05-21-2018 at 03:01 AM.
    Using Windows 10 with Code Blocks and MingW.

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,736
    rc is only used for resource files. You can't compile an entire exe with it. So you're probably doing something wrong.
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    No, no, I was just putting it simple. Of course after rc.exe I compiled it with command: cl.exe program.cpp resource.res, and it compiled successfully.
    Using Windows 10 with Code Blocks and MingW.

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,736
    Oh sorry... Does this happen only with this program? Try compiling something else to test it, without a resource file. My apologies, I've never used Visual Studio. Why are you running it through the command line, by the way?
    Devoted my life to programming...

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Quote Originally Posted by GReaper View Post
    Try compiling something else to test it, without a resource file.
    The program is working fine, it's just that the resource file will be a 16-bit program once it's created.

    Why are you running it through the command line, by the way?
    I prefer CodeBlocks as editor for just a simple test program.

    I created a project in VS and got the same result as with command line.
    Using Windows 10 with Code Blocks and MingW.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 04-03-2017, 06:17 AM
  2. VS2010 Adding a file as a binary resource
    By gman64 in forum Windows Programming
    Replies: 0
    Last Post: 03-07-2013, 06:27 AM
  3. Program to test a user input vs a saved password
    By epsilon tau in forum C Programming
    Replies: 1
    Last Post: 03-13-2012, 01:16 PM
  4. Reconstructing a vector saved in a binary file..
    By Shamino in forum C++ Programming
    Replies: 10
    Last Post: 02-02-2012, 07:13 PM
  5. Program can't locate resource when run outside IDE
    By IdioticCreation in forum C++ Programming
    Replies: 10
    Last Post: 03-31-2009, 09:41 PM

Tags for this Thread