Visual Studio 2019 Unable to start program, the system cannot find the file specified

Harper 26 Reputation points
2021-07-07T02:00:58.007+00:00

Hello everyone, current I am trying to run a program on Visual Studio but unfortunately it will not work. Whenever I try to run the project, I get an error as can be seen below.
112315-image.png

For reference, I am using some file from opencv and have included what I was told into my linker and directories under the property tab. This is also a c++ project. I am really stumped on how to fix this and would appreciate some guidance.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,762 questions
{count} votes

4 answers

Sort by: Most helpful
  1. WayneAKing 4,921 Reputation points
    2021-07-07T03:40:51+00:00

    If you don't want to see the message in the popup
    dialog that you used in the Subject of this thread,
    then stop trying to run a program before it has been
    built successfully.

    If the compile fails, no object file (*.obj) will be
    created so the link step will fail. If the compile
    is successful and an obj file is created, but the link
    step fails for some other reason - such as not being
    able to find a lib file as in the case shown in your
    pic - then an exe will not be created.

    When an exe cannot be created because of compile and/or
    link errors, then naturally it can't be run as it doesn't
    exist. I suggest you stop trying to run all the time,
    relying on implicit building, and start doing an explicit
    Build (F7) or Rebuild. Fix all errors shown in the Build
    Output - and preferably fix all Warnings as well - and only
    then try to Run the program.

    The Link error in the image you posted is sufficiently
    explicit that you should be able to resolve why the
    Linker can't find the .lib specified.

    • Wayne
    0 comments No comments

  2. Sam of Simple Samples 5,546 Reputation points
    2021-07-07T03:51:36.013+00:00

    Look at the output in the image you posted. It has:

    1>LINK : Fatal error LNK1194: cannot open File 'opencv_calib3d4S2d.1ib'  
    

    You need to fix that. The link did not work; that is why the exe file does not exist.

    Do you know what directory that file is in? In VS go to the project's properties and in the VC++ Directories add that directory to the Library Directories as in VC++ Directories Property Page.

    0 comments No comments

  3. WayneAKing 4,921 Reputation points
    2021-07-07T03:51:52.873+00:00

    In the Project Properties, under Linker->General have
    you set "Additional Library Directories" to tell the
    Linker where to find the opencv *.lib files?

    • Wayne

  4. Isaac Tait 21 Reputation points
    2021-07-18T17:17:51.023+00:00

    For anyone with similar issues (without errors or warning though) I resolved by creating the code files within the project. More info here

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.