Results 1 to 2 of 2

Thread: Undefined reference to qt-Lib after compiling qt static for amv7 under windows

  1. #1
    Join Date
    Jan 2014
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Undefined reference to qt-Lib after compiling qt static for amv7 under windows

    Good Morning Ladies and Gentlemen,
    I'm trying to compile qt for armv7 on a Beaglebone to crosscompile on windows 7. It compiles without any error and if i use this version with a helloworld project without qt-libs it is working. But If I use i.e QCoreApplication or QByteArray or any Qt-lib i get this error:

    C:\Sourcery_standard\bin\arm-none-linux-gnueabi-g++.exe -static -static-libgcc -o untitled18 main.obj -LC:/qt-everywhere-opensource-src-5.2.0_27Versuch/qtbase/lib -lQt5Core -lpthread
    main.obj: In function `main':
    C:\build-untitled18-static-Debug/..\untitled18/main.cpp:5: undefined reference to `QCoreApplication::QCoreApplication(int&, char**, int)'
    C:\build-untitled18-static-Debug/..\untitled18/main.cpp:7: undefined reference to `QCoreApplication::exec()'
    C:\build-untitled18-static-Debug/..\untitled18/main.cpp:7: undefined reference to `QCoreApplication::~QCoreApplication()'
    C:\build-untitled18-static-Debug/..\untitled18/main.cpp:7: undefined reference to `QCoreApplication::~QCoreApplication()'
    collect2.exe: error: ld returned 1 exit status


    I'm using qt5.2.0 and the compiler from sourcery codebench for armgnu and mingw4.8
    May you help me with it?
    Thanks

    Here are additional infos

    PRO-File:
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2014-01-13T09:56:09
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core
    8.  
    9. QT -= gui
    10.  
    11. TARGET = untitled18
    12. CONFIG += console
    13. CONFIG -= app_bundle
    14. CONFIG+=static
    15. TEMPLATE = app
    16.  
    17.  
    18. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 



    main.cpp
    Qt Code:
    1. #include <QCoreApplication>
    2. #include
    3. int main(int argc, char *argv[])
    4. {
    5. QCoreApplication a(argc, argv);
    6.  
    7. return a.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 

    QTDIR:
    Qt Code:
    1. C:\qt-everywhere-opensource-src-5.2.0_27Versuch\qtbase
    To copy to clipboard, switch view to plain text mode 
    PATH:
    Qt Code:
    1. C:\qt-everywhere-opensource-src-5.2.0_27Versuch\qtbase\bin;C:\Sourcery_standard\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;%QUARTUS_ROOTDIR%\bin;C:\Program Files (x86)\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files (x86)\Pinnacle\Shared Files\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\CineForm\Tools;C:\Program Files\TortoiseSVN\bin;C:\Program Files\doxygen\bin;ÍSROOT%\tools\pcb\bin;ÍSROOT%\tools\fet\bin;ÍSROOT%\OpenAccess\bin\win32\opt;ÍSROOT%\tools\bin;ÍSROOT%\tools\Capture;ÍSROOT%\tools\PSpice\Library;ÍSROOT%\tools\PSpice;
    To copy to clipboard, switch view to plain text mode 


    Configure-Skript:
    Qt Code:
    1. REM Set up Windows SDK for 64bit
    2.  
    3. set PATH=C:\Program Files (x86)\Git\bin;C:\Qt_5.2\Tools\mingw48_32\i686-w64-mingw32\;C:\Qt_5.2\Tools\mingw48_32\i686-w64-mingw32\bin;C:\Qt_5.2\Tools\mingw48_32\i686-w64-mingw32\include;C:\Qt_5.2\Tools\mingw48_32\bin;C:\Sourcery_standard\bin;C:\qt-everywhere-opensource-src-5.2.0_27Versuch\qtbase\bin;C:\qt-everywhere-opensource-src-5.2.0_27Versuch\gnuwin32\bin;C:\qt-everywhere-opensource-src-5.2.0_27Versuch\qtrepotools\bin;%PATH%
    4. set QMAKESPEC=win32-g++
    5.  
    6.  
    7. cd..
    8. cd..
    9. cd qtcmd
    10. copy qmake.conf "C:\qt-everywhere-opensource-src-5.2.0_27Versuch\qtbase\mkspecs\linux-arm-gnueabi-g++"
    11. copy Makefile.win32 "C:\qt-everywhere-opensource-src-5.2.0_27Versuch\qtbase\qmake"
    12. cd..
    13. cd qt-everywhere-opensource-src-5.2.0_27Versuch\qtbase
    14.  
    15. configure -developer-build -opensource -confirm-license -no-c++11 -static -make libs -make tools -nomake examples -no-widgets -no-opengl -no-openvg -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -no-nis -no-iconv -largefile -no-fontconfig -no-warnings-are-errors -qt-zlib -no-icu -no-gif -no-libpng -no-freetype -no-harfbuzz -no-angle -no-incredibuild-xge -no-plugin-manifests -qmake -fully-process -no-rtti -no-strip -no-openssl -no-dbus -no-audio-backend -no-wmf-backend -qml-debug -no-directwrite
    16. mingw32-make
    To copy to clipboard, switch view to plain text mode 




    QMAKE.conf
    Qt Code:
    1. #
    2. # qmake configuration for building with arm-linux-gnueabi-g++
    3. #
    4.  
    5. MAKEFILE_GENERATOR = UNIX
    6. CONFIG += incremental gdb_dwarf_index
    7. QMAKE_INCREMENTAL_STYLE = sublib
    8.  
    9. include(../common/linux.conf)
    10. include(../common/gcc-base-unix.conf)
    11. include(../common/g++-unix.conf)
    12.  
    13. # modifications to g++.conf
    14. QMAKE_CC = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-gcc.exe
    15. QMAKE_CXX = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-g++.exe
    16. QMAKE_LINK = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-g++.exe
    17. QMAKE_LINK_SHLIB = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-g++.exe
    18.  
    19. # modifications to linux.conf
    20. QMAKE_AR = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-ar.exe cqs
    21. QMAKE_OBJCOPY = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-objcopy.exe
    22. QMAKE_NM = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-nm.exe -P
    23. QMAKE_STRIP = C:\Sourcery_standard\bin\arm-none-linux-gnueabi-strip.exe
    24. COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mthumb -mfloat-abi=softfp
    25. QMAKE_CFLAGS += $${COMPILER_FLAGS}
    26. QMAKE_CXXFLAGS += $${COMPILER_FLAGS}
    27. QMAKE_CXXFLAGS_RELEASE += -O3
    28.  
    29. QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
    30. QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32
    31. QMAKE_LIBS_NETWORK = -lws2_32
    32. QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
    33. QMAKE_LIBS_OPENGL_ES2 = -llibEGL -llibGLESv2 -lgdi32 -luser32
    34. QMAKE_LIBS_OPENGL_ES2_DEBUG = -llibEGLd -llibGLESv2d -lgdi32 -luser32
    35. QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
    36. QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
    37.  
    38. QMAKE_CFLAGS_RELEASE = -Os -momit-leaf-frame-pointer
    39. QMAKE_LFLAGS = -static -static-libgcc
    40. DEFINES += QT_STATIC_BUILD
    41. load(qt_config)
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2014
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Undefined reference to qt-Lib after compiling qt static for amv7 under windows

    any ideas??

Similar Threads

  1. Replies: 2
    Last Post: 11th August 2012, 17:37
  2. Help with undefined reference in Windows with mingw32
    By qlands in forum Qt Programming
    Replies: 4
    Last Post: 23rd March 2012, 11:41
  3. undefined reference for qt creator in windows
    By morteza in forum Qt Programming
    Replies: 1
    Last Post: 13th October 2011, 19:19
  4. Undefined reference in static binding in Linux
    By gcubar in forum Installation and Deployment
    Replies: 9
    Last Post: 28th February 2011, 15:20
  5. Undefined Reference Errors Compiling Examples
    By nerdasaurus in forum Newbie
    Replies: 5
    Last Post: 4th December 2010, 06:39

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.