Compiling problem: "Invalid header in executable"

This is a discussion on Compiling problem: "Invalid header in executable" within the C Programming forums, part of the General Programming Boards category; Ok I've made a C program for an assignment that's due in, run it and it worked flawlessly, no problems. ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    3

    Compiling problem: "Invalid header in executable"

    Ok I've made a C program for an assignment that's due in, run it and it worked flawlessly, no problems. Then I went to change the name of the file to "Kyle_Heriot.c" (as according to the submission instructions) and ever since I can't run the program. Every time I try to run it I get an error message:

    "Invalid header in executable"

    I've tried making the project again several times and copy/pasting the code over, still the same error...don't know where I've gone wrong, could anyone help me?

    The executable is in "EasyWin (.exe)" format in .c node, and the compiler is Borland C++

    Any feedback is appreciated, thanks.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Quote Originally Posted by ckyle
    The executable is in "EasyWin (.exe)" format in .c node, and the compiler is Borland C++
    It's hard to tell from just an anecdote -- but isn't EasyWin about a decade out of date?
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Why did you rename your executable to ".c"?


    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    Registered User
    Join Date
    Feb 2006
    Posts
    3
    Renamed the node to .c because my university is teaching us C programming instead of C++ (god knows why..) and they tell us to change to .c node...

    Any one know how to fix my problem though? Cheers

  5. #5
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    Is it an included file? If so make sure the file name matches the #include name.
    But that would produce a linker error

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,442
    Seems to me like you've renamed prog.cpp to be prog.exe or something.
    And in the process likely to have lost both....

    > I've tried making the project again several times
    If you're sure you still have the source, then copy it somewhere safe and then remake the project from scratch (not by trying to fix the current project).
    Make sure it satisfies your assignment naming rules, then copy the contents of your backup code into a new file created inside the new project.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 03-20-2008, 07:59 AM
  2. Strange problem with classes in header files
    By samGwilliam in forum C++ Programming
    Replies: 2
    Last Post: 02-29-2008, 03:55 AM
  3. Problem Compiling Program
    By wco5002 in forum C++ Programming
    Replies: 13
    Last Post: 11-06-2007, 11:56 AM
  4. Graphics header file problem
    By Senkoma in forum C++ Programming
    Replies: 1
    Last Post: 09-04-2001, 05:26 PM
  5. Problem with Borland 5.5 Compiling Windows Programs
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 08-28-2001, 09:04 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21