Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] collect2.exe:-1: error: error: ld returned 1 exit status
Forum Updated to NodeBB v4.3 + New Features

[Solved] collect2.exe:-1: error: error: ld returned 1 exit status

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 29.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GGILOYAN
    wrote on last edited by
    #1

    Hi

    Please help.
    I whant to use openCV in my Qt App for android.

    I added the following paths in .pro file

    ANDROID_OPENCV = C:/openCV/sdk/native

    LIBS +=
    $$ANDROID_OPENCV/libs/armeabi/libopencv_calib3d.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_flann.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_objdetect.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_contrib.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_video.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_ml.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_legacy.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_highgui.a
    $$ANDROID_OPENCV/3rdparty/libs/armeabi/liblibjpeg.a
    $$ANDROID_OPENCV/3rdparty/libs/armeabi/liblibpng.a
    $$ANDROID_OPENCV/3rdparty/libs/armeabi/liblibtiff.a
    $$ANDROID_OPENCV/3rdparty/libs/armeabi/liblibjasper.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_ts.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_imgproc.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_core.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_androidcamera.a
    $$ANDROID_OPENCV/libs/armeabi/libopencv_features2d.a

    INCLUDEPATH += $$ANDROID_OPENCV/jni/include/opencv/
    INCLUDEPATH += $$ANDROID_OPENCV/jni/include/opencv2/
    INCLUDEPATH += $$ANDROID_OPENCV/jni/include/

    When I comile project I get the following error

    collect2.exe:-1: error: error: ld returned 1 exit status

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You need to post the complete error log, with this only line it's impossible to help you

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GGILOYAN
        wrote on last edited by
        #3

        This is what I copied from Compile Output

        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::ExrDecoder(): error: undefined reference to 'Imf::Chromaticities::Chromaticities(Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::readHeader(): error: undefined reference to 'Imf::globalThreadCount()'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::readHeader(): error: undefined reference to 'Imf::InputFile::InputFile(char const*, int)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::readHeader(): error: undefined reference to 'Imf::InputFile::header() const'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::readHeader(): error: undefined reference to 'Imf::chromaticities(Imf::Header const&)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&): error: undefined reference to 'Imf::OutputFile::OutputFile(char const*, Imf::Header const&, int)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&): error: undefined reference to 'Imf::Slice::Slice(Imf::PixelType, char*, unsigned int, unsigned int, int, int, double, bool, bool)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&): error: undefined reference to 'Imf::FrameBuffer::insert(char const*, Imf::Slice const&)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::readData(cv::Mat&): error: undefined reference to 'Imf::InputFile::setFrameBuffer(Imf::FrameBuffer const&)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::readData(cv::Mat&): error: undefined reference to 'Imf::InputFile::readPixels(int, int)'
        C:/openCV/sdk/native/libs/armeabi/libopencv_highgui.a(grfmt_exr.cpp.o):grfmt_exr.cpp:function cv::ExrDecoder::readData(cv::Mat&): error: undefined reference to 'Imf::InputFile::readPixels(int, int)'
        collect2.exe: error: ld returned 1 exit status

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Looks like you are not linking the OpenExr library

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GGILOYAN
            wrote on last edited by
            #5

            I only need openCV.
            Why I should link openExp library ?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              You use "OpenCV":http://opencv.org/ that was built with "OpenExr":http://www.openexr.com/ support.
              But you did not provided a path to OpenExr library.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                GGILOYAN
                wrote on last edited by
                #7

                Thank you. I will try to do it!

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  GGILOYAN
                  wrote on last edited by
                  #8

                  I solved it using this
                  http://stackoverflow.com/questions/12583590/qt-android-project-with-opencv-tbb-compiling-errors

                  Thanks

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved