Thursday, May 03, 2007

VC++ linker error

VC++ linker error :
----------------------------

LNK1181: cannot open input file 'C:\Program.obj'

Actually I linked the library file as follows ...


Project->Properties->Linker->Input option, I added the library file as follows

C:\Program Files\Microsoft Visual Studio\VC98\Lib\d3drm.lib.

But I got the error LNK1181: cannot open input file 'C:\Program.obj' .

The reason for this error is "Program Files" folder has blank in it...

ddraw.lib winmm.lib C:\program Files\Microsoft Visual Studio\VC98\Lib\d3drm.lib.

Blank is the separator between two libraries in an input option.

So the compiler consider it as

Program is one of the library. So in order to avoid this error I did the following :

Solution :
----------------

ddraw.lib winmm.lib "C:\Program Files\Microsoft Visual Studio\VC98\Lib\d3drm.lib"

if we specified the library file in a Double Quotation, From the starting quotation the compiler will search until the end quotation.

1 comment:

suhadris said...

Hello,

I am a newbie to VC++. I am trying to run simple program using OpenCV library.
After F5 I get message: "The application has failed to start because cxcore210d.dll was not found."

I have this file on my HDD, I added path to it to VC++. Which additional conditions should I fulfill to get my program working?

This is the code:

// OpenCV_Helloworld.cpp : Defines the entry point for the console application.
// Created for build/install tutorial, Microsoft Visual C++ 2010 Express and OpenCV 2.1.0

#include "stdafx.h"

#include
#include
#include

int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("funny-pictures-cat-goes-pew.jpg");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);

cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);

return 0;
}

thank you!