Author Topic: Problem with opencv library (fatal error : No such file or directory)  (Read 31579 times)

Offline Zekk

  • Single posting newcomer
  • *
  • Posts: 9
Hello everyone,

I want to use opencv library (v.2.4.5) with C::B (v.12.11) I have followed the instruction bellow (http://opencv.willowgarage.com/wiki/CodeBlocks), and I also set the PATH variable environnement on this adress : C:\opencv\bluid\x86\mingw\bin (my opencv library was extract in C:\).

But when I try to test a sample program like  "demhist" in the folder "C:\OpenCV\samples\cpp\demhist.cpp", I have the following message : fatal error : imgproc.hpp : No such file or directory

I'm looking for a solution since yesterday but I can't find anything.

Do you have any suggestions ?
« Last Edit: June 28, 2013, 02:06:58 pm by Zekk »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
have you done step 3 to 6?

Offline Zekk

  • Single posting newcomer
  • *
  • Posts: 9
yes, I even try to uninstall/reinstall Code Blocks and restart the steps

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
search for the  improc.hpp  and add the the path to the search directories....

Offline Zekk

  • Single posting newcomer
  • *
  • Posts: 9
They are two files  imgproc.hpp.

The first is in C:\opencv\build\include (I already add this one)
The second is in C:\opencv\module

Even if I add the  adress in Search directories (Compiler), it's still not work
« Last Edit: June 28, 2013, 02:07:22 pm by Zekk »

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
How do you include 'improc.hpp'?

Code
<improc.hpp>

or

Code
<opencv2/improc/improc.hpp>

Offline Zekk

  • Single posting newcomer
  • *
  • Posts: 9
I include 'imgproc.hpp' with :

 <imgproc.hpp>

I already try with

<opencv2/imgproc/imgproc.hpp>

but it doesn't work.
« Last Edit: June 28, 2013, 02:05:23 pm by Zekk »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Did you made a project, or did you loaded only the source file?

try to: Project->Build options->Other Options, add there a -v and rebuild. Then post the FULL BUILD LOG, from the "Build Log" tab here.

greetings

Offline Zekk

  • Single posting newcomer
  • *
  • Posts: 9
Here the message :

Code
-------------- Build: Debug in test_opencv (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions  -g -v    -IC:\opencv\include -IC:\opencv\modules -IC:\opencv\build\include  -c C:\Users\Clems\Documents\Programmation\test_opencv\main.cpp -o obj\Debug\main.o
Using built-in specs.
COLLECT_GCC=mingw32-g++.exe
Target: mingw32
Configured with: ../../src/gcc-4.7.1/configure --build=mingw32 --enable-languages=c,c++,ada,fortran,objc,obj-c++ --enable-threads=win32 --enable-libgomp --enable-lto --enable-fully-dynamic-string --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-gnu-ld --disable-nls --disable-win32-registry --disable-symvers --disable-build-poststage1-with-cxx --disable-werror --prefix=/mingw32tdm --with-local-prefix=/mingw32tdm --enable-cxx-flags='-fno-function-sections -fno-data-sections' --with-pkgversion=tdm-1 --enable-sjlj-exceptions --with-bugurl=http://tdm-gcc.tdragon.net/bugs
Thread model: win32
gcc version 4.7.1 (tdm-1)
COLLECT_GCC_OPTIONS='-Wall' '-fexceptions' '-g' '-v' '-I' 'C:\opencv\include' '-I' 'C:\opencv\modules' '-I' 'C:\opencv\build\include' '-c' '-o' 'obj\Debug\main.o' '-mtune=i386' '-march=i386'
 c:/program files (x86)/codeblocks/mingw/bin/../libexec/gcc/mingw32/4.7.1/cc1plus.exe -quiet -v -I C:\opencv\include -I C:\opencv\modules -I C:\opencv\build\include -iprefix c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/ C:\Users\Clems\Documents\Programmation\test_opencv\main.cpp -quiet -dumpbase main.cpp -mtune=i386 -march=i386 -auxbase-strip obj\Debug\main.o -g -Wall -version -fexceptions -o C:\Users\Clems\AppData\Local\Temp\ccIFFwHz.s
GNU C++ (tdm-1) version 4.7.1 (mingw32)
compiled by GNU C version 4.7.1, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../mingw32/include"
ignoring duplicate directory "c:/program files (x86)/codeblocks/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.1/include/c++"
ignoring duplicate directory "c:/program files (x86)/codeblocks/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.1/include/c++/mingw32"
ignoring duplicate directory "c:/program files (x86)/codeblocks/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.1/include/c++/backward"
ignoring duplicate directory "c:/program files (x86)/codeblocks/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.1/include"
ignoring duplicate directory "c:/program files (x86)/codeblocks/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.1/../../../../include"
ignoring duplicate directory "c:/program files (x86)/codeblocks/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.1/include-fixed"
ignoring nonexistent directory "c:/program files (x86)/codeblocks/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.1/../../../../mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 C:\opencv\include
 C:\opencv\modules
 C:\opencv\build\include
 c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++
 c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/mingw32
 c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include/c++/backward
 c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include
 c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/../../../../include
 c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.7.1/include-fixed
End of search list.
GNU C++ (tdm-1) version 4.7.1 (mingw32)
compiled by GNU C version 4.7.1, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1b05afeca9d712f769248af52f554d5e
C:\Users\Clems\Documents\Programmation\test_opencv\main.cpp:9:23: fatal error: imgproc.hpp: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings (0 minutes, 0 seconds)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Code
C:\Users\Clems\Documents\Programmation\test_opencv\main.cpp:9:23: fatal error: imgproc.hpp: No such file or directory

so, is this header called "imgproc.hpp" or "improc.hpp"

check your typo....

Offline Zekk

  • Single posting newcomer
  • *
  • Posts: 9
Re: Problem with opencv library (fatal error : No such file or directory)
« Reply #10 on: June 28, 2013, 02:12:09 pm »
Ho ok, I'm sorry ... wrong writing. I corrected my previous topics : the right name is "imgproc.hpp"  as you said (but problem remain the same).

Sorry for that.
« Last Edit: June 28, 2013, 02:13:49 pm by Zekk »

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Problem with opencv library (fatal error : No such file or directory)
« Reply #11 on: June 28, 2013, 03:44:47 pm »
What directories do you have in your 'project->build options-> search directories->compiler' for top level?

Offline Zekk

  • Single posting newcomer
  • *
  • Posts: 9
Re: Problem with opencv library (fatal error : No such file or directory)
« Reply #12 on: June 28, 2013, 05:00:32 pm »
I have nothing.

When I read your anwser, I try to add in  'project->build options-> search directories'  the same things than in 'settings ->compiler ->search directories', but I still have the same error.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Problem with opencv library (fatal error : No such file or directory)
« Reply #13 on: June 28, 2013, 11:22:12 pm »
Did you actually performed the steps in http://opencv.willowgarage.com/wiki/CodeBlocks? Because if you did you would have your search dirs in 'project->build options-> search directories->compiler'!

And again, what directories do you have in 'settings ->compiler ->search directories' or wherever you have them?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Problem with opencv library (fatal error : No such file or directory)
« Reply #14 on: June 29, 2013, 01:02:49 am »
Please decide what MinGW GCC you are trying to use!
Then, tell us which one you are trying to use?

You appear to be trying to use two different MinGW GCC in a single project this will NOT work!!!

One of them.
Code
C:\opencv\bluid\x86\mingw\bin

The othe one.
Code
c:/program files (x86)/codeblocks/mingw/bin/

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org