Menu

No Such File or Directory

TexasOwl
2009-02-11
2012-09-26
  • TexasOwl

    TexasOwl - 2009-02-11

    I am trying to rund an example from the boo "Learning Open CV" by Bradski.

    I have down loaded the library and other files under c:/Dev-C++/OpenCV.

    I am trying to run the following file:

    include <c:/Dev-Cpp/OpenCV/otherlib/highgui/highgui.h>

    int main( int argc, char* argv ) {
    IplImage
    img = cvLoadImage( argv[1] );
    cvNamedWindow( “Example1”, CV_WINDOW_AUTOSIZE );
    cvShowImage( “Example1”, img );
    cvWaitKey(0);
    cvReleaseImage( &img );
    cvDestroyWindow( “Example1” );
    }

    I get the following error :
    56 C:\Dev-Cpp\My Programs\Image load.cpp:1
    c:/Dev-Cpp/OpenCV/otherlib/highgui/highgui.h: No such file or directory.

    I am running version 4.9.8.0 on windows XP

     
    • Wayne Keen

      Wayne Keen - 2009-02-11

      One note: You know that storing your projects in a path with spaces is a very very bad idea? So is putting spaces in your file names.

      Please do NOT excerpt the error messages, post your full compile log as talked about in the Basic 3 information in the thread titled "Please Read Before Posting a Question"

      Now, the error message is pretty straight-forward...

      c:/Dev-Cpp/OpenCV/otherlib/highgui/highgui.h: No such file or directory.

      Your message gavve no sign you tried to run this down. It says it can't find the header file. That can be because you don't have it, or the path to it is hosed somehow. That is the first place to check.

      Wayne

       
      • TexasOwl

        TexasOwl - 2009-02-11

        Wayne:
        Thanks for the reply!
        I appologise for not including the correct file. Here it is:
        Compiler: Default compiler
        Building Makefile: "C:\Dev-Cpp\My Programs\Makefile.win"
        Executing make...
        make.exe -f "C:\Dev-Cpp\My Programs\Makefile.win" all
        g++.exe -c "Image load.cpp" -o "Image load.o" -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw32" -I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/OpenCV/lib" -I"C:/Dev-Cpp/OpenCV/lib"

        Image load.cpp:1:56: c:/Dev-Cpp/OpenCV/otherlib/highgui/highgui.h: No such file or directory
        Image load.cpp: In function int main(int, char**)': Image load.cpp:3:IplImage' undeclared (first use this function)
        Image load.cpp:3: (Each undeclared identifier is reported only once for each
        function it appears in.)
        Image load.cpp:3: `img' undeclared (first use this function)

        Image load.cpp:3: cvLoadImage' undeclared (first use this function) Image load.cpp:4: stray '\223' in program Image load.cpp:4: stray '\224' in program Image load.cpp:4:Example1' undeclared (first use this function)
        Image load.cpp:4: CV_WINDOW_AUTOSIZE' undeclared (first use this function) Image load.cpp:4:cvNamedWindow' undeclared (first use this function)
        Image load.cpp:5: stray '\223' in program
        Image load.cpp:5: stray '\224' in program
        Image load.cpp:5: `cvShowImage' undeclared (first use this function)

        Image load.cpp:6: cvWaitKey' undeclared (first use this function) Image load.cpp:7:cvReleaseImage' undeclared (first use this function)
        Image load.cpp:8: stray '\223' in program
        Image load.cpp:8: stray '\224' in program
        Image load.cpp:8: `cvDestroyWindow' undeclared (first use this function)

        make.exe: *** ["Image] Error 1

        Execution terminated

        I will correct the space in the file folder. I did read about that when I searched the various FAC sheets and the previous threads.

        I have checked and higui is in the path as both a c header file and a resourse file. I have tried higui both with and with out the .h. I have studied the help page and attempted to set the project options parameters to various configurations.

        I have looked at every resource I can find. The book says: "“include” directories will typically be named something like ... …/opencv/otherlibs/
        highgui."

         
    • cpns

      cpns - 2009-02-11

      So take a look in c:/Dev-Cpp/OpenCV/otherlib/highgui/

      Does that folder exist, and is highgui.h in it?

       
      • TexasOwl

        TexasOwl - 2009-02-11

        cpns:
        Thanks for the quick reply.
        There is both a resource file and a c header file in that path.

         
    • Wayne Keen

      Wayne Keen - 2009-02-11

      These error messages:

      Image load.cpp:4: stray '\223' in program

      arrive because you have the wrong kind of quotes in your code. Usually this is the result of code being input, directly or indirectly, from a word processor like Word.

      Now, the file is not being found for a reason. Dev is not just not seeing to annoy you. To debug things, I would move the header to the local directory and eliminate the extended path specification.

      Note that you don't appear to be linking any libraries. You do realize that including the headers is not enough?

      Wayne

       
    • cpns

      cpns - 2009-02-11

      Do not create projects in ""C:\Dev-Cpp\My Programs\&quot;. Firstly it contains spaces, and secondly it is a subfolder of the Dev-C++ installation folder. Both are known to cause problems with Dev-C++ in some, but not all circumstances. This may not be your problem, but it is a good idea to at least exclude it from suspicion.

      Besides putting user files in a program installation folder is always a bad idea.

      Clifford

       
      • Wayne Keen

        Wayne Keen - 2009-02-11

        I should have noticed the funky quotes earlier....

         
    • cpns

      cpns - 2009-02-12

      > Note that you don't appear to be linking any libraries. You do realize
      > that including the headers is not enough?

      You may be right but you cannot know. He's building from a project which uses separate compilation and linking stages, so there will be no linker options in the compilation step, and linking will not occur until successful compilation of all units.

      Clifford

       
      • Wayne Keen

        Wayne Keen - 2009-02-12

        You are right, but I was trying to get ahead of the next question with my dubious statement.

        Waynebozo

         
    • TexasOwl

      TexasOwl - 2009-02-13

      Thanks for all of the help!

      I incorporated all of the comments but still had problems.

      I then started from scratch. I removed Dev-C++ and reloaded the latest version.

      It now works.

      Thanks
      Dick Laughlin

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.