Thread: This program requares microsoft windows

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    2

    Red face This program requares microsoft windows

    Hello,
    at university i got task to make program for old 16bit compiler C600min(C optimizing compiler version 6.0). For example:
    Code:
                         //a.c
                         int main(void){
                                  int a = 10;
                                   return 0;
                         }
    cl.exe a.c //compile and generate exe file.
    Seems everything good but then i tray to execute exe file i got message "This program requares microsoft windows".
    I'm using XP. May it's not possible? May i need win 3?

    Thanks for any ideas.
    Last edited by CornedBee; 10-29-2007 at 12:30 PM. Reason: Put the code tags in the right place.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm pretty sure you can work around the problem, but why are you using an ancient compiler?

    The latest Visual Studio C++ 2005 Express is available from MS for free (Search for Visual Studio C++ download or some such on the MS Website). Although you may need to use a different compiler at your school, using the latest compiler at home should be OK.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    So you're compiling a program in an ancient compiler and wondering why the program doesn't work on a modern OS?

    Edit: I can't believe I got beaten by a millisecond.

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Apparently you are using some setting that makes the executable a windows program, and the compilers code improperly checks for specific version numbers istead of the proper format of just makign sure the version is equal to or greater than a certain value. This is a common problem in older software, the only workaround is to hex edit the executable and change the version ID that it is looking for , or to disassemble the code and skip the windows check. Then again if you can find the setting in your compiler that is making this a windows executable you can make it a DOS executable, which is what you wrote it as.

    Wish I hadnt lost that copy of Turbo C/C++ I had years ago.

    Better yet, just go to Free Turbo C++ for Windows
    Last edited by abachler; 10-29-2007 at 09:44 AM.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Turbo C is OK if you REALLY want to create a DOS executable, but if you are actually wanting to make a Windows (32-bit) executable, then it's not such a good choice.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    That link isnt for the old 16 bit version, its for the new (2005) release of Turbo C for windows XP.

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    2
    Reason why i use ancient compiler is teacher, old strange teacher.

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Why not ask the teacher for help?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    I like that answer best of all. Some teachers present problems that they know the students will probably not be able to solve without help. Its a test to see if the students know what they know and are willing to ask for help when they have a question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Anyone view this forum on a Blackberry?
    By Sharke in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 06-09-2009, 04:02 PM
  3. Replies: 2
    Last Post: 12-22-2006, 08:45 PM
  4. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  5. Replies: 1
    Last Post: 12-17-2002, 01:06 AM