Eclipse CDT nicht finden können, opencv 2 header-Dateien
Ich installiert opencv 2.3.1 mit macports und die neueste Eclipse-CDT. Jetzt versuche ich, um diesen code zu kompilieren:
> #include <iostream.h>
> #include <cv.h> //or opencv.hpp, no difference
>
> int main(int argc, char **argv) {
>
>
> }
Ich getan haben, alle Schritte der http://opencv.itseez.com/doc/tutorials/introduction/linux_eclipse/linux_eclipse.html aber die Ausgabe des Compilers ist:
> make all Building file: ../main.cpp Invoking: GCC C++ Compiler g++
> -I/opt/local/include/opencv -I/opt/local/include/opencv2 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp" In file included from
> /usr/include/c++/4.2.1/backward/iostream.h:31,
> from ../main.cpp:8: /usr/include/c++/4.2.1/backward/backward_warning.h:32:2: warning:
> #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section
> 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of
> the deprecated header <iostream.h>. To disable this warning use
> -Wno-deprecated. In file included from ../main.cpp:9: /opt/local/include/opencv2/opencv.hpp:46:33: error:
> opencv2/core/core_c.h: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:47:33: error:
> opencv2/core/core.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:48:39: error:
> opencv2/flann/miniflann.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:49:39: error:
> opencv2/imgproc/imgproc_c.h: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:50:39: error:
> opencv2/imgproc/imgproc.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:51:35: error:
> opencv2/video/video.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:52:45: error:
> opencv2/features2d/features2d.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:53:43: error:
> opencv2/objdetect/objdetect.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:54:39: error:
> opencv2/calib3d/calib3d.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:55:29: error: opencv2/ml/ml.hpp:
> No such file or directory /opt/local/include/opencv2/opencv.hpp:56:39:
> error: opencv2/highgui/highgui_c.h: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:57:39: error:
> opencv2/highgui/highgui.hpp: No such file or directory
> /opt/local/include/opencv2/opencv.hpp:58:39: error:
> opencv2/contrib/contrib.hpp: No such file or directory make: ***
> [main.o] Error 1
>
> **** Build Finished ****
Was mache ich falsch?
- Durch Inkludieren von /opt/local/include und /opt/local/include/opencv funktionierte es komischerweise..
Du musst angemeldet sein, um einen Kommentar abzugeben.
okay.. ich hatte viel Mühe in diesem selbst.
Müssen Sie sich int die opencv-Ordner-Struktur, die Sie installiert haben, damit diese header-Dateien selbst. Manchmal sind Sie nicht in der Ort, den install guide Ihnen sagt, was Sie sind.
In meinem computer, zum Beispiel, die meisten der header-Dateien, die ich brauchte in:
[Installationsverzeichnis]/include/opencv
[Installationsverzeichnis]/include/opencv2
aber EINIGE waren:
[Installationsverzeichnis]/modules/core/include/opencv2
[Installationsverzeichnis]/modules/highgui/include/opencv2 etc
müssen Sie zu finden, die include-Dateien. Dann gehe auf deine IDE (eclipse). In eclopse sollte es eine Einstellung für die "include-Verzeichnisse"
Stellen Sie Ihre IDE zu suchen include-Dateien in den Verzeichnissen, wo man weiß, die include-Dateien sind.
Dann stellen Sie sicher, fügen Sie die Bibliotheken. Fragen Sie, wenn Sie dabei Hilfe benötigen.
Die Fehler, die oben aufgeführt sind, zeigt, dass Sie nicht angegeben haben, werden die Pfade der include-Verzeichnisse.zuerst suchen Sie die include-Verzeichnisse in Ihrem Installationsverzeichnis.In der Regel sind Sie in /home/usr/include/opencv und /home/usr/local/include/opencv
Nachdem diese Dateien, die Sie öffnen Projekteigenschaften in Eclipse CDT. Wählen Sie " GCC C++ compiler -- Verzeichnisse, und fügen Sie die include-Verzeichnisse dort. Wählen Sie " GCC C++ Linker-option und geben Sie den library Pfad in der Regel ist es /usr/local/lib
Die Bibliotheken angeben, in Anführungszeichen zu z.B. "Lebenslauf" , "highgui" etc.Dadurch wird die Konfiguration abzuschließen.
Hoffe, es hilft.