System can not find file after compile/linking...

This is a discussion on System can not find file after compile/linking... within the C Programming forums, part of the General Programming Boards category; So I successfully compiled (GCC) and linked (G++) my project (name=rap00.exe) but when I try to run it (from the ...

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    59

    System can not find file after compile/linking...

    So I successfully compiled (GCC) and linked (G++) my project (name=rap00.exe) but when I try to run it (from the I: drive for instance) by double clicking on the program icon the computer gives me the error:
    "Windows cannot find 'I:\rap00.exe'. Make sure you typed the name correctly, and then try again..."

    If I go to the command line and 'dir' OR 'ls' the file rap00.exe is present but if I run it again the computer returns:
    "The system cannot find the file I:\rap00.exe."

    What have I done wrong?

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Right click on the program icon, and select "properties". Look where the icon is going to start the program from. Right now, that program is not in the same place, so the system can't run it.

    Move the program into the same system where the icon will start it from, or change the start location of the icon, to reflect the true location of the program. One or the other - they have to be the same, in order to work. Save the properties, if you change it.

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    59
    Adak - The location is correct and that would not explain the problem in the command line.

  4. #4
    Registered User
    Join Date
    Nov 2009
    Location
    Maryland, USA
    Posts
    46
    Does it run if you start it from the command line?
    That is, just type the command I:\rap00 and see if it starts.

    Also, are you sure you're consistently using two zeros, not two capital Os?

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by evb@studioe.com View Post
    Adak - The location is correct and that would not explain the problem in the command line.
    The location is obviously NOT correct, or you wouldn't be getting the "Windows cannot find ..." error, when you tried to start it with the icon.

    You may have a program with a very similar name, but the named program is not where Windows is looking for it.

    That much should be obvious, from the error message.

  6. #6
    Registered User
    Join Date
    Jan 2012
    Posts
    59
    Turns out the compiled code (rap00.exe) is trying to start a program (posix.exe) that is not on the computer that I tried to run it on.

  7. #7
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,832
    Ah. It should have given a clear error message then.

  8. #8
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    And it gives this error message:
    "The system cannot find the file I:\rap00.exe."

    Are you trying to run this inside a VM?

  9. #9
    Registered User
    Join Date
    Jan 2012
    Posts
    59
    It was compiled using Microsoft services for Unix.
    I did not realize SFU compiled apps are dependent on Posix like Cygwin and MinGW are.
    So when I run rap00.exe it tries to open a Posix shell and fails.
    The error message is totally misleading.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error : "the system cannot find the file specified"
    By arian in forum C++ Programming
    Replies: 11
    Last Post: 03-06-2011, 01:15 PM
  2. using std::find linking fail in linux
    By mellaicp in forum C++ Programming
    Replies: 2
    Last Post: 12-09-2009, 07:38 PM
  3. Replies: 18
    Last Post: 05-27-2008, 12:23 AM
  4. Linking problems trying to compile QT application
    By Maragato in forum C++ Programming
    Replies: 1
    Last Post: 08-19-2005, 10:08 PM
  5. Linking a plotter to a PC (XP system used)
    By Frandy in forum Windows Programming
    Replies: 4
    Last Post: 09-14-2004, 08:24 AM

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