visual studio 2005 with opencv2.3.1 help

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

visual studio 2005 with opencv2.3.1 help

Luthfan Hadi Pramono
hi all,

i'm still new using opencv library, i want to create application using opencv library.

i have spesification of my laptop:
- os, windows xp sp2
- MS Visual Studio 2005
- OpenCV 2.3.1

the extraction of the sourcecode is in this directory, "C:/Program Files/opencv"

and i have build the opencv binary file in this directory, "C:/Program Files/OpenCV2.3.1". using CMAKE.
and it have the list of directory inside, like this:
- 3rdparty
- bin
- CMakeFiles
- data
- doc
- include
- junk
- lib
- modules
- unix-install
- win-install

i'm trying to run the sample code, and configuring the requirement as shown in this link "http://opencv.willowgarage.com/wiki/VisualC%2B%2B"

but i still getting error as shown, when i try to build the sourcecode.
fatal error LNK1104: cannot open file 'C:\Program Files\OpenCV2.3.1\lib\debug\opencv_core231d.lib C:\Program.obj'

i already check the input in my project properties. '<My Project> > Properties > Linker > Input > Additional Dependencies' and put the content as shown in the link above.

is there anyone can help me with this problem, as specially the configuration of opencv231 library in ms visual studio 2005.

Best regards,
phann



Reply | Threaded
Open this post in threaded view
|

Re: visual studio 2005 with opencv2.3.1 help

Francisco Ares
Hi,

I have run into the same problems, as I did also as you, I have built
OpenCV from source code.

You will have to add to your VisualStudio project properties all of the
path for the include files, the path for the libraries to be linked to your
project (although you will need the DLLs, that is the way C++ handles that,
for each DLL, there is a lib) respecting debug and release versions:

My build was in root directory, so exchange all occurrences
"C:\OpenCV-2.3.1" to your own path. I have added the build of Intel's free
TBB (Thread Building Blocks) on building OpenCV, so that is why the
references to "tbb30_20101215oss", that might be removed if you did not use
it.

Don't forget to add the DLLs folder to your PATH environment variable in
Windows, so the final project might be run outside the VisualStudio
environment.

Hope it helps
Francisco



' add to PATH in Debug mode (this is where the executable of your project
will look for DLLs):

C:\OpenCV-2.3.1\bin\debug;C:\OpenCV-2.3.1\bin\debug;C:\tbb30_20101215oss\build\vsproject\ia32;


' "#include# additional folders (this is where your compiler will look for
included headers) :

C:\OpenCV-2.3.1;C:\OpenCV-2.3.1\include;C:\OpenCV-2.3.1\include\opencv;C:\OpenCV-2.3.1\modules\core\include;C:\OpenCV-2.3.1\modules\flann\include;C:\OpenCV-2.3.1\modules\imgproc\include;C:\OpenCV-2.3.1\modules\video\include;C:\OpenCV-2.3.1\modules\highgui\include;C:\OpenCV-2.3.1\modules\ml\include;C:\OpenCV-2.3.1\modules\calib3d\include;C:\OpenCV-2.3.1\modules\features2d\include;C:\OpenCV-2.3.1\modules\objdetect\include;C:\OpenCV-2.3.1\modules\legacy\include;C:\OpenCV-2.3.1\modules\contrib\include;

' pré-processor directive to add, DEBUG mode (not sure on any, but you
might give each one a trial - many has appeared while building OpenCV):

WIN32,_WINDOWS,_WIN32_WINNT=0x0501,_CRT_SECURE_NO_DEPRECATE,_CRT_NONSTDC_NO_DEPRECATE,_SCL_SECURE_NO_WARNINGS,_DEBUG,

' pré-processor directives, RELEASE mode (same as before):

WIN32,_WINDOWS,_WIN32_WINNT=0x0501,_CRT_SECURE_NO_DEPRECATE,_CRT_NONSTDC_NO_DEPRECATE,_SCL_SECURE_NO_WARNINGS,NDEBUG,

' add "linker" dependencies, DEBUG mode (libraries that allows DLL
interaction - it might be that your project does not need all):

$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib glu32.lib
opengl32.lib opencv_core231d.lib opencv_flann231d.lib
opencv_imgproc231d.lib opencv_highgui231d.lib opencv_ml231d.lib
opencv_video231d.lib opencv_objdetect231d.lib opencv_features2d231d.lib
opencv_calib3d231d.lib opencv_legacy231d.lib opencv_contrib231d.lib
opencv_ml231d.lib opencv_video231d.lib opencv_objdetect231d.lib
opencv_calib3d231d.lib opencv_features2d231d.lib opencv_flann231d.lib
opencv_highgui231d.lib opencv_imgproc231d.lib opencv_core231d.lib zlibd.lib

' add "linker" dependencies, RELEASE mode (same as above):

$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib glu32.lib
opengl32.lib opencv_core231.lib opencv_flann231.lib opencv_imgproc231.lib
opencv_highgui231.lib opencv_ml231.lib opencv_video231.lib
opencv_objdetect231.lib opencv_features2d231.lib opencv_calib3d231.lib
opencv_legacy231.lib opencv_contrib231.lib opencv_ml231.lib
opencv_video231.lib opencv_objdetect231.lib opencv_calib3d231.lib
opencv_features2d231.lib opencv_flann231.lib opencv_highgui231.lib
opencv_imgproc231.lib opencv_core231.lib zlib.lib

' add the folders of the dependencies for the "linker", DEBUG mode (folders
where the linker will look for the libraries above):

C:\OpenCV-2.3.1\lib\Debug\;C:\OpenCV-2.3.1\3rdparty\lib\Debug\;C:\tbb30_20101215oss\build\vsproject\ia32;

' add the folders of the dependencies for the "linker", RELEASE mode (same
as above):

C:\OpenCV-2.3.1\lib\Release\;C:\OpenCV-2.3.1\3rdparty\lib\Release;C:\tbb30_20101215oss\build\vsproject\ia32;





--
"If you have an apple and I have an apple and we exchange apples then you
and I will still each have one apple. But if you have an idea and I have
one idea and we exchange these ideas, then each of us will have two ideas."
- George Bernard Shaw
Reply | Threaded
Open this post in threaded view
|

Re: visual studio 2005 with opencv2.3.1 help

Luthfan Hadi Pramono
Hi too,

finally I have done it and make some setup configuration documentation for that..
i also write a setup documentation of opencv2.3.1 in minGW, but i still got problems and i haven't finish it yet because I' m still busy..
i hope my documentation will be useful in the future..

thanks for share..
Phann

--- On Tue, 12/13/11, Francisco Ares <[hidden email]> wrote:

From: Francisco Ares <[hidden email]>
Subject: Re: [OpenCV] visual studio 2005 with opencv2.3.1 help
To: [hidden email]
Date: Tuesday, December 13, 2011, 9:53 PM
















 



 


   
     
     
      Hi,

I have run into the same problems, as I did also as you, I have built OpenCV from source code.

You will have to add to your VisualStudio project properties all of the path for the include files, the path for the libraries to be linked to your project (although you will need the DLLs, that is the way C++ handles that, for each DLL, there is a lib) respecting debug and release versions:


My build was in root directory, so exchange all occurrences  "C:\OpenCV-2.3.1" to your own path. I have added the build of Intel's free TBB (Thread Building Blocks) on building OpenCV, so that is why the references to "tbb30_20101215oss", that might be removed if you did not use it.


Don't forget to add the DLLs folder to your PATH environment variable in Windows, so the final project might be run outside the VisualStudio environment.

Hope it helps
Francisco



' add to PATH in Debug mode (this is where the executable of your project will look for DLLs):


C:\OpenCV-2.3.1\bin\debug;C:\OpenCV-2.3.1\bin\debug;C:\tbb30_20101215oss\build\vsproject\ia32;


' "#include# additional folders (this is where your compiler will look for included headers) :


C:\OpenCV-2.3.1;C:\OpenCV-2.3.1\include;C:\OpenCV-2.3.1\include\opencv;C:\OpenCV-2.3.1\modules\core\include;C:\OpenCV-2.3.1\modules\flann\include;C:\OpenCV-2.3.1\modules\imgproc\include;C:\OpenCV-2.3.1\modules\video\include;C:\OpenCV-2.3.1\modules\highgui\include;C:\OpenCV-2.3.1\modules\ml\include;C:\OpenCV-2.3.1\modules\calib3d\include;C:\OpenCV-2.3.1\modules\features2d\include;C:\OpenCV-2.3.1\modules\objdetect\include;C:\OpenCV-2.3.1\modules\legacy\include;C:\OpenCV-2.3.1\modules\contrib\include;


' pré-processor directive to add, DEBUG mode (not sure on any, but you might give each one a trial - many has appeared while building OpenCV):

WIN32,_WINDOWS,_WIN32_WINNT=0x0501,_CRT_SECURE_NO_DEPRECATE,_CRT_NONSTDC_NO_DEPRECATE,_SCL_SECURE_NO_WARNINGS,_DEBUG,


' pré-processor directives, RELEASE mode (same as before):

WIN32,_WINDOWS,_WIN32_WINNT=0x0501,_CRT_SECURE_NO_DEPRECATE,_CRT_NONSTDC_NO_DEPRECATE,_SCL_SECURE_NO_WARNINGS,NDEBUG,

' add "linker" dependencies, DEBUG mode (libraries that allows DLL interaction - it might be that your project does not need all):


$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib glu32.lib opengl32.lib opencv_core231d.lib opencv_flann231d.lib opencv_imgproc231d.lib opencv_highgui231d.lib opencv_ml231d.lib opencv_video231d.lib opencv_objdetect231d.lib opencv_features2d231d.lib opencv_calib3d231d.lib opencv_legacy231d.lib opencv_contrib231d.lib opencv_ml231d.lib opencv_video231d.lib opencv_objdetect231d.lib opencv_calib3d231d.lib opencv_features2d231d.lib opencv_flann231d.lib opencv_highgui231d.lib opencv_imgproc231d.lib opencv_core231d.lib zlibd.lib


' add "linker" dependencies, RELEASE mode (same as above):

$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib glu32.lib opengl32.lib opencv_core231.lib opencv_flann231.lib opencv_imgproc231.lib opencv_highgui231.lib opencv_ml231.lib opencv_video231.lib opencv_objdetect231.lib opencv_features2d231.lib opencv_calib3d231.lib opencv_legacy231.lib opencv_contrib231.lib opencv_ml231.lib opencv_video231.lib opencv_objdetect231.lib opencv_calib3d231.lib opencv_features2d231.lib opencv_flann231.lib opencv_highgui231.lib opencv_imgproc231.lib opencv_core231.lib zlib.lib


' add the folders of the dependencies for the "linker", DEBUG mode (folders where the linker will look for the libraries above):

C:\OpenCV-2.3.1\lib\Debug\;C:\OpenCV-2.3.1\3rdparty\lib\Debug\;C:\tbb30_20101215oss\build\vsproject\ia32;


' add the folders of the dependencies for the "linker", RELEASE mode (same as above):

C:\OpenCV-2.3.1\lib\Release\;C:\OpenCV-2.3.1\3rdparty\lib\Release;C:\tbb30_20101215oss\build\vsproject\ia32;






--
"If you have an apple and I have an apple and we exchange apples then you and I will still each have one apple. But if you have an idea and I have one idea and we exchange these ideas, then each of us will have two ideas." - George Bernard Shaw