Attention, mines: LNK1104: cannot open file 'c:Program.obj'


Did you ever see the error message "LNK1104: cannot open file 'c:\Program.obj'"? No need to say that you are not that kind of a programmer who generates OBJ files in the root of disk C:... So, what's up and how to fix that?

Either
use short 8.3 path in additional dependencies, or put the long path
into "Linker | General | Additional Library Directories" and simply the
name of the library without path into Additional Dependencies.

I
realize that getting such a message is a sort of shock (I've got it
today myself and still feel it :-)), here is the secret:
"C:\Program.obj" is the long path like "C:\Program Files\Microsoft
Platform SDK for Windows Server 2003 R2\Lib" cut after the first space
and appended with the default extension ".obj".

Comments (3)

  1. Huang Bin says:

    Hi,

    What if I install Microsoft SDKs?

    Is this error only due to SDK lib? Or I need to do "put the long path into "Linker | General | Additional Library Directories" and simply the name of the library without path into Additional Dependencies" for all the libraries?

    Btw, what is short 8.3 path? I am a newbie to OpenCV. Thanks for answering my stupid questions in advance.

  2. EldarM1 says:

    Please, read the explanation. If you will put your own personal library into something like c:Odd Libararies of Minemylib.lib and do the same mistake, you will get a message about missing c:Odd.obj

    Short 8.3 format has nothing to do with OpenCV, it's the old DOS format of file names: 8 characters for name and 3 for extensions. To support older programs that may still no understand new longer names, Windows supports a "ghost" name of each file which is not longer than 8.3 format requires. You can see it from the command line using dir command.

  3. siavash says:

    I have a problem in this matter(message: can not open "program.obj").Is it that anyone guide me in easy form.

Skip to main content