Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

xxxx.o not found



  • Hi everyone :)

    I have a problem with an example that I want to run from internet. Here is the exemple :
    https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2player_2main_8cpp-example.html

    I copied and past it into a new project on my Qt. I also wrote the .pro as follow :

    HEADERS += \
       player.h \
       mediaapp.h \
    
    SOURCES += \
       player.cpp \
       mediapp.cpp \
       main.cpp \
    
    INCLUDEPATH += "usr/include/QtGstreamer" \ 
                                        "usr/include/qt5" \
    
    QT += gui core \
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 
    

    the qmake "run" without problem.
    But when I compile, I get 28 error all base on : "File not found : player.o". ent "File not found : main.o".. I dont know what I have to do...

    Thanks for help :)


  • Moderators

    hi @Chanchan
    adding \ behind player.cpp mediapp.cpp and player.h

    should help tremendously

    don't forget to rerun qmake after changes in the pro file



  • Oh sorry I just forget it when I wrote my message here (I'm with my phone). But on my .pro, the "" are present


  • Lifetime Qt Champion

    @Chanchan

    Please copy&paste the original file!

    It is impossible to help you if we don't see the same file as you.

    That said,

    • please remove the \ after the laste line in the HEADERS and SOURCES sections.
    • are you missing a / before usr/include?
    • "usr/include/qt5" should not be needed
    • remove the \ after core
    • delete the build folder and the .pro.user
    • rebuild your project

    It should work.

    Regards



  • Hi @aha_1980 :) Thx for your response :)

    HEADERS += \
        player.h \
        mediaapp.h
    
    SOURCES += \
        player.cpp \
        mediaapp.cpp \
        main.cpp
    
    INCLUDEPATH += "/usr/include/QtGStreamer" \
                    "/usr/include/qt4"
    
    
    QT += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    

    I applied your tips, it still doesn't work :/

    My error :
    player.o :-1: erreur : In function « Player::Player(QWidget*) » :

    player.o :-1: erreur : In function « QGlib::Type QGlib::GetTypeQGst::Message() » :

    I got 39 error like these essentially from player.o


  • Moderators

    @Chanchan your include path is still wrong, maybe.

    Is /usr/include/... supposed to be a relative path to your .pro file or an absolute one?


  • Lifetime Qt Champion

    @Chanchan said in xxxx.o not found:

    player.o :-1: erreur : In function « Player::Player(QWidget*) » :
    player.o :-1: erreur : In function « QGlib::Type QGlib::GetTypeQGst::Message() » :
    I got 39 error like these essentially from player.o

    Yes but these are new errors. Probably linker errors, but as that's hard to tell if you provide so few context.

    So please show your compile log with at least 10 lines before the first error. Or upload the complete log somewhere and provide a link here.

    Regards



  • @aha_1980
    Here is my compile code from the begining until some errors, I am sorry it is in french, if you dont understand to hesitate to ask me :

    12:26:13: Débute : "/usr/bin/make"
    g++ -pipe -g -std=gnu++11 -Wall -W -dM -E -o moc_predefs.h ../Qt5.9.1/5.9.1/gcc_64/mkspecs/features/data/dummy.cpp
    /home/tomy/Qt5.9.1/5.9.1/gcc_64/bin/moc -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/mkspecs/linux-g++ -I/home/tomy/EssaiQtGst -I/usr/include/QtGStreamer -I/usr/include/qt4 -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include/QtWidgets -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include/QtGui -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include/QtCore -I. -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -I/usr/include/c++/4.8/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include ../EssaiQtGst/player.h -o moc_player.cpp
    g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../EssaiQtGst -I. -isystem /usr/include/QtGStreamer -isystem /usr/include/qt4 -I../Qt5.9.1/5.9.1/gcc_64/include -I../Qt5.9.1/5.9.1/gcc_64/include/QtWidgets -I../Qt5.9.1/5.9.1/gcc_64/include/QtGui -I../Qt5.9.1/5.9.1/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I../Qt5.9.1/5.9.1/gcc_64/mkspecs/linux-g++ -o player.o ../EssaiQtGst/player.cpp
    /home/tomy/Qt5.9.1/5.9.1/gcc_64/bin/moc -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/mkspecs/linux-g++ -I/home/tomy/EssaiQtGst -I/usr/include/QtGStreamer -I/usr/include/qt4 -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include/QtWidgets -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include/QtGui -I/home/tomy/Qt5.9.1/5.9.1/gcc_64/include/QtCore -I. -I/usr/include/c++/4.8 -I/usr/include/x86_64-linux-gnu/c++/4.8 -I/usr/include/c++/4.8/backward -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include ../EssaiQtGst/mediaapp.h -o moc_mediaapp.cpp
    g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../EssaiQtGst -I. -isystem /usr/include/QtGStreamer -isystem /usr/include/qt4 -I../Qt5.9.1/5.9.1/gcc_64/include -I../Qt5.9.1/5.9.1/gcc_64/include/QtWidgets -I../Qt5.9.1/5.9.1/gcc_64/include/QtGui -I../Qt5.9.1/5.9.1/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I../Qt5.9.1/5.9.1/gcc_64/mkspecs/linux-g++ -o mediaapp.o ../EssaiQtGst/mediaapp.cpp
    g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../EssaiQtGst -I. -isystem /usr/include/QtGStreamer -isystem /usr/include/qt4 -I../Qt5.9.1/5.9.1/gcc_64/include -I../Qt5.9.1/5.9.1/gcc_64/include/QtWidgets -I../Qt5.9.1/5.9.1/gcc_64/include/QtGui -I../Qt5.9.1/5.9.1/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I../Qt5.9.1/5.9.1/gcc_64/mkspecs/linux-g++ -o main.o ../EssaiQtGst/main.cpp
    g++ -Wl,-rpath,/home/tomy/Qt5.9.1/5.9.1/gcc_64/lib -o EssaiQtGst player.o mediaapp.o main.o -L/home/tomy/Qt5.9.1/5.9.1/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
    player.o : Dans la fonction « Player::Player(QWidget*) » :
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:30 : référence indéfinie vers « QGst::Ui::VideoWidget::VideoWidget(QWidget*, QFlagsQt::WindowType) »
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:30 : référence indéfinie vers « QGst::Ui::VideoWidget::~VideoWidget() »
    player.o : Dans la fonction « Player::~Player() » :
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:39 : référence indéfinie vers « QGst::Element::setState(QGst::State) »
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:40 : référence indéfinie vers « QGst::Ui::VideoWidget::stopPipelineWatch() »
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:36 : référence indéfinie vers « QGst::Ui::VideoWidget::~VideoWidget() »
    player.o : Dans la fonction « Player::setUri(QString const&) » :
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:51 : référence indéfinie vers « QGst::ElementFactory::make(char const*, char const*) »
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:54 : référence indéfinie vers « QGst::Ui::VideoWidget::watchPipeline(QGlib::RefPointerQGst::Pipeline const&) »
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:56 : référence indéfinie vers « QGst::Pipeline::bus() const »
    /home/tomy/build-EssaiQtGst-Desktop_Qt_5_9_1_GCC_64bit-Debug/../EssaiQtGst/player.cpp:57 : référence indéfinie vers « QGst::Bus::addSignalWatch() »


  • Lifetime Qt Champion

    @Chanchan said in xxxx.o not found:

    g++ -Wl,-rpath,/home/tomy/Qt5.9.1/5.9.1/gcc_64/lib -o EssaiQtGst player.o mediaapp.o main.o -L/home/tomy/Qt5.9.1/5.9.1/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread

    That is your linker command line. It shows you are linking against serveral libraries, but not QGst.

    Therefore, add to your .pro file: LIBS += -L/path/to/qgst/library -lqgst and replace path and library name with correct values :)



  • @aha_1980 Ok I see thank you.
    The problem is : How do I know, which library I should add ? I tried to add the entire folder by default but it doesnt work (I guess I havr to specify which library I need). :

    LIBS += -L/usr/lib/x86_64-linux-gnu


  • Lifetime Qt Champion

    @Chanchan

    https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/build_system_integration.html mentions to use pkg-config. I have not used that before, but the page also mentions the library names:

    • Qt5GLib-2.0
    • Qt5GStreamer-1.0
    • Qt5GStreamerUi-1.0
    • Qt5GStreamerUtils-1.0

    You may need one or multiple of them.



  • @aha_1980
    Okey Thank you very much, I will try to implement it with that !



  • Ok I update, it seems that I dont have Qt5Gstreamer libraries and when I try to get them from the shell (sudo apt-get install libqt5gstreamer-1.0-0 for exemple) I only receive 'impossible to found the package.


Log in to reply