Results 1 to 2 of 2

Thread: Undefined symbols for architecture x86_64 opencv

  1. #1
    Join Date
    Jan 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Undefined symbols for architecture x86_64 opencv

    I'm a newbie to qt and opencv
    using qt creator 3 with qt 5 on os x 10.9.1 opencv 2.4.8
    When i'm trying out with my first program, i get this error.
    Any one please help me.
    Thank you

    Qt Code:
    1. #include <opencv2/core/core.hpp>
    2. #include <opencv2/highgui/highgui.hpp>
    3.  
    4. using namespace cv;
    5.  
    6. int main()
    7. {
    8. //read image
    9. Mat image = imread("img.jpg");
    10. //create image window named "My image"
    11. namedWindow("My Image", CV_WINDOW_AUTOSIZE);
    12. //show the image on window
    13. imshow("My image", image);
    14. //wait key for 5000ms
    15. waitKey(5000);
    16. return 0;
    17. }
    To copy to clipboard, switch view to plain text mode 

    test.pro
    Qt Code:
    1. QT += core
    2.  
    3. QT -= gui
    4.  
    5. TARGET = test
    6. CONFIG += console
    7. CONFIG -= app_bundle
    8.  
    9. TEMPLATE = app
    10.  
    11. INCLUDEPATH += /usr/local/include
    12. LIBS += -L/usr/local/lib \
    13. -opencv_core.dylib \
    14. -opencv_imgproc.dylib \
    15. -opencv_highgui.dylib \
    16. -opencv_features2d.dylib \
    17. -opencv_calib3d.dylib
    18. OTHER_FILES += img.jpg
    19. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

    Error generated
    Qt Code:
    1. Undefined symbols for architecture x86_64:
    2. "cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
    3. _main in main.o
    4. "cv::namedWindow(std::string const&, int)", referenced from:
    5. _main in main.o
    6. "cv::Mat::deallocate()", referenced from:
    7. _main in main.o
    8. "cv::imread(std::string const&, int)", referenced from:
    9. _main in main.o
    10. "cv::imshow(std::string const&, cv::_InputArray const&)", referenced from:
    11. _main in main.o
    12. "cv::waitKey(int)", referenced from:
    13. _main in main.o
    14. "cv::fastFree(void*)", referenced from:
    15. _main in main.o
    16. ld: symbol(s) not found for architecture x86_64
    17. clang: error: linker command failed with exit code 1 (use -v to see invocation)
    18. make: *** [test] Error 1
    19. 23:13:36: The process "/usr/bin/make" exited with code 2.
    20. Error while building/deploying project test (kit: Desktop Qt 5.2.0 clang 64bit)
    21. When executing step 'Make'
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,546
    Thanks
    13
    Thanked 1,578 Times in 1,507 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Undefined symbols for architecture x86_64 opencv

    You probably received earlier errors regarding invalid arguments to your linker. Lines 13 through 17 should read:
    Qt Code:
    1. -lopencv_core \
    2. -lopencv_imgproc \
    3. ...
    To copy to clipboard, switch view to plain text mode 
    (that is a lower case L)

Similar Threads

  1. Qt + cocoa : Undefined symbols for architecture x86_64
    By karankumar1609 in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2013, 08:43
  2. no debug symbols in executable (-arch x86_64)
    By bruce2011 in forum Qt Programming
    Replies: 2
    Last Post: 24th August 2011, 14:42
  3. qmake: detecting x86_64 architecture?
    By akos.maroy in forum Qt Programming
    Replies: 3
    Last Post: 2nd August 2008, 11:26
  4. /usr/bin/ld: Undefined symbols:
    By ataffard in forum Qt Programming
    Replies: 0
    Last Post: 2nd May 2008, 01:24
  5. Undefined symbols in Qtopia
    By minguzzi in forum Installation and Deployment
    Replies: 0
    Last Post: 13th September 2006, 13:59

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.