With cmake 3.5.0 (on windows) and CMAKE_AUTORCC and one rcc.qrc file in add_executable every build (using ninja) compiles the rcc file and links again even if there is nothing changed. Is that normal or is there something missing in my cmakelists.txt file?
cmake_minimum_required(VERSION 3.2)
project(auto_moc_uic_rcc)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package (Qt5Widgets REQUIRED)
add_executable(${PROJECT_NAME}
main.cpp
MainWindow
MainWindow.ui
rcc.qrc
)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
If I remove CMAKE_AUTORCC and replace it with qt5_add_resources(RCC rcc.qrc) and add ${RCC} to the executable, the project only builds and links if there is actually something changed.
Output of cmake (from cmake_gui):
The C compiler identification is GNU 4.9.1
The CXX compiler identification is GNU 4.9.1
Check for working C compiler using: Ninja
Check for working C compiler using: Ninja -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler using: Ninja
Check for working CXX compiler using: Ninja -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Configuring done
First run ninja -v:
[1/7] cmd.exe /C "cd /D E:\source\builds\qt\debug\Test\junk\auto_moc_uic_rcc\auto_moc_uic_rcc && E:\bin\cmake\bin\cmake.exe -E cmake_autogen E:/source/builds/qt/debug/Test/junk/auto_moc_uic_rcc/auto_moc_uic_rcc/CMakeFiles/auto_moc_uic_rcc_automoc.dir/ Debug"
Generating ui_MainWindow.h
Generating moc_MainWindow.cpp
[2/7] E:\Qt\mingw\bin\c++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic-rcc -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -g -MMD -MT CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj -MF CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj.d -o CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj -c CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp
[3/7] E:\Qt\mingw\bin\c++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic-rcc -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -g -MMD -MT CMakeFiles/auto_moc_uic_rcc.dir/MainWindow.cpp.obj -MF CMakeFiles/auto_moc_uic_rcc.dir/MainWindow.cpp.obj.d -o CMakeFiles/auto_moc_uic_rcc.dir/MainWindow.cpp.obj -c E:/source/src/Test/junk/autouic/auto_moc_uic-rcc/MainWindow.cpp
[4/7] E:\Qt\mingw\bin\c++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic-rcc -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -g -MMD -MT CMakeFiles/auto_moc_uic_rcc.dir/main.cpp.obj -MF CMakeFiles/auto_moc_uic_rcc.dir/main.cpp.obj.d -o CMakeFiles/auto_moc_uic_rcc.dir/main.cpp.obj -c E:/source/src/Test/junk/autouic/auto_moc_uic-rcc/main.cpp
[5/7] cmd.exe /c
[6/7] E:\Qt\mingw\bin\c++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic-rcc -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -g -MMD -MT CMakeFiles/auto_moc_uic_rcc.dir/auto_moc_uic_rcc_automoc.cpp.obj -MF CMakeFiles/auto_moc_uic_rcc.dir/auto_moc_uic_rcc_automoc.cpp.obj.d -o CMakeFiles/auto_moc_uic_rcc.dir/auto_moc_uic_rcc_automoc.cpp.obj -c auto_moc_uic_rcc_automoc.cpp
[7/7] cmd.exe /C "cd . && E:\Qt\mingw\bin\c++.exe -g CMakeFiles/auto_moc_uic_rcc.dir/main.cpp.obj CMakeFiles/auto_moc_uic_rcc.dir/MainWindow.cpp.obj CMakeFiles/auto_moc_uic_rcc.dir/auto_moc_uic_rcc_automoc.cpp.obj CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj -o auto_moc_uic_rcc.exe -Wl,--out-implib,libauto_moc_uic_rcc.dll.a -Wl,--major-image-version,0,--minor-image-version,0 E:/Qt/qt/lib/libQt5Widgetsd.a E:/Qt/qt/lib/libQt5Guid.a E:/Qt/qt/lib/libQt5Cored.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
Second run ninja -v. Consecutive runs have the same output:
[1/3] cmd.exe /C "cd /D E:\source\builds\qt\debug\Test\junk\auto_moc_uic_rcc\auto_moc_uic_rcc && E:\bin\cmake\bin\cmake.exe -E cmake_autogen E:/source/builds/qt/debug/Test/junk/auto_moc_uic_rcc/auto_moc_uic_rcc/CMakeFiles/auto_moc_uic_rcc_automoc.dir/ Debug"
[2/3] E:\Qt\mingw\bin\c++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic-rcc -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -g -MMD -MT CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj -MF CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj.d -o CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj -c CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp
[3/3] cmd.exe /C "cd . && E:\Qt\mingw\bin\c++.exe -g CMakeFiles/auto_moc_uic_rcc.dir/main.cpp.obj CMakeFiles/auto_moc_uic_rcc.dir/MainWindow.cpp.obj CMakeFiles/auto_moc_uic_rcc.dir/auto_moc_uic_rcc_automoc.cpp.obj CMakeFiles/auto_moc_uic_rcc.dir/CMakeFiles/auto_moc_uic_rcc.dir/qrc_rcc.cpp.obj -o auto_moc_uic_rcc.exe -Wl,--out-implib,libauto_moc_uic_rcc.dll.a -Wl,--major-image-version,0,--minor-image-version,0 E:/Qt/qt/lib/libQt5Widgetsd.a E:/Qt/qt/lib/libQt5Guid.a E:/Qt/qt/lib/libQt5Cored.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
Here is the output of ninja -v when I use qt5_add_resources(RCC rcc.qrc) instead of CMAKE_AUTORCC:
[1/8] cmd.exe /C "cd /D E:\source\builds\qt\debug\Test\junk\auto_moc_uic_rcc\auto_moc_uic && E:\bin\CMake\bin\cmake.exe -E cmake_autogen E:/source/builds/qt/debug/Test/junk/auto_moc_uic_rcc/auto_moc_uic/CMakeFiles/auto_moc_uic_automoc.dir/ """
Generating ui_MainWindow.h
Generating moc_MainWindow.cpp
[2/8] cmd.exe /C "cd /D E:\source\builds\qt\debug\Test\junk\auto_moc_uic_rcc\auto_moc_uic && E:\Qt\qt\bin\rcc.exe -name rcc -o E:/source/builds/qt/debug/Test/junk/auto_moc_uic_rcc/auto_moc_uic/qrc_rcc.cpp E:/source/src/Test/junk/autouic/auto_moc_uic/rcc.qrc"
[3/8] E:\Qt\mingw\bin\g++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -MMD -MT CMakeFiles/auto_moc_uic.dir/MainWindow.cpp.obj -MF CMakeFiles/auto_moc_uic.dir/MainWindow.cpp.obj.d -o CMakeFiles/auto_moc_uic.dir/MainWindow.cpp.obj -c E:/source/src/Test/junk/autouic/auto_moc_uic/MainWindow.cpp
[4/8] E:\Qt\mingw\bin\g++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -MMD -MT CMakeFiles/auto_moc_uic.dir/qrc_rcc.cpp.obj -MF CMakeFiles/auto_moc_uic.dir/qrc_rcc.cpp.obj.d -o CMakeFiles/auto_moc_uic.dir/qrc_rcc.cpp.obj -c qrc_rcc.cpp
[5/8] E:\Qt\mingw\bin\g++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -MMD -MT CMakeFiles/auto_moc_uic.dir/main.cpp.obj -MF CMakeFiles/auto_moc_uic.dir/main.cpp.obj.d -o CMakeFiles/auto_moc_uic.dir/main.cpp.obj -c E:/source/src/Test/junk/autouic/auto_moc_uic/main.cpp
[6/8] cmd.exe /c
[7/8] E:\Qt\mingw\bin\g++.exe -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -I. -IE:/source/src/Test/junk/autouic/auto_moc_uic -isystem E:/Qt/qt/include -isystem E:/Qt/qt/include/QtWidgets -isystem E:/Qt/qt/include/QtGui -isystem E:/Qt/qt/include/QtCore -isystem E:/Qt/qt/mkspecs/win32-g++ -MMD -MT CMakeFiles/auto_moc_uic.dir/auto_moc_uic_automoc.cpp.obj -MF CMakeFiles/auto_moc_uic.dir/auto_moc_uic_automoc.cpp.obj.d -o CMakeFiles/auto_moc_uic.dir/auto_moc_uic_automoc.cpp.obj -c auto_moc_uic_automoc.cpp
[8/8] cmd.exe /C "cd . && E:\Qt\mingw\bin\g++.exe CMakeFiles/auto_moc_uic.dir/main.cpp.obj CMakeFiles/auto_moc_uic.dir/MainWindow.cpp.obj CMakeFiles/auto_moc_uic.dir/qrc_rcc.cpp.obj CMakeFiles/auto_moc_uic.dir/auto_moc_uic_automoc.cpp.obj -o auto_moc_uic.exe -Wl,--out-implib,libauto_moc_uic.dll.a -Wl,--major-image-version,0,--minor-image-version,0 E:/Qt/qt/lib/libQt5Widgets.a E:/Qt/qt/lib/libQt5Gui.a E:/Qt/qt/lib/libQt5Core.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
And consecutive runs:
[1/1] cmd.exe /C "cd /D E:\source\builds\qt\debug\Test\junk\auto_moc_uic_rcc\auto_moc_uic && E:\bin\CMake\bin\cmake.exe -E cmake_autogen E:/source/builds/qt/debug/Test/junk/auto_moc_uic_rcc/auto_moc_uic/CMakeFiles/auto_moc_uic_automoc.dir/ """
Related
We have a C++ library (libEDM.a) that integrates Eigen. The library is standalone as a core API to be wrapped with Rcpp and pybind11 for user interfaces.
Since Eigen is called internally from the library, we do not use RcppEigen in the Rcpp wrapper.
This works fine on linux and OSX R package builds, and the mingw-32 (arch - i386) build for R (using devtools::check_win_release).
However, for the (arch - x64) build with mingw-64, the linker fails to find Eigen references in the C++ libEDM.a, vis (from winbuilder):
d:/Compiler/gcc-4.9.3/mingw_64/bin/g++ -m64 -shared -s -static-libgcc -o rEDMNew.dll tmp.def CCM.o ComputeError.o DataFrame.o Embed.o EmbedDim.o Multiview.o PredictInterval.o PredictNL.o RcppEDMCommon.o RcppExports.o SMap.o Simplex.o -L./cppEDM/src/ -lEDM -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LD:/RCompile/recent/R-3.6.1/bin/x64 -lR
./cppEDM/src//libEDM.a(SMap.o):SMap.cc:(.text+0x245d): undefined reference to `Eigen::internal::first_aligned_impl<16, Eigen::CwiseUnaryOp<Eigen::internal::scalar_abs2_op<double>, Eigen::Block<Eigen::Block<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>, -1, 1, false> const, -1, 1, false> const>, true>::run(Eigen::CwiseUnaryOp<Eigen::internal::scalar_abs2_op<double>, Eigen::Block<Eigen::Block<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, 1, true>, -1, 1, false> const, -1, 1, false> const> const&)'
A wrinkle for the mingw-64 is the addition of -Wa,-mbig-obj flag passed to the linker, as it seems Eigen templates with mingw-64 exceed the number of sections allowed.
Perhaps it is a mingw-64 linker/option issue, as the mingw-32 and other builds seem to work fine?
Update:
It seems that the linker configuration and Eigen are stuck in some kind of recursive search. Using Rtools35 on a Windows 10 box with R 3.4.3, and the following Makevars.win:
PKG_CPPFLAGS = -I./cppEDM/src -I../
PKG_LIBS = -L./cppEDM/src/ -lEDM
CXX_STD = CXX11
$(SHLIB): cppEDM/src/libEDM.a
cppEDM/src/libEDM.a:
#(cd cppEDM/src && $(MAKE) -f makefile.mingw \
CC="$(CC)" CFLAGS="-Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../ $(CPICFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)")
The build has two phases. First the Rcpp interface code is compiled by the canonical Makefile, then the libEDM.a is built in cppEDM/src, which is then linked against the Rcpp objects for the final library.
The i386 build seems fine, creates and installs rEDMNew.dll as noted below. The x64 build appears to build without incident, and then takes about 20 minutes to create rEDMNew.dll in the src/-x64/ directory. However, it then seems stalled, CPU running ~50% for hours... and the rEDMNew.dll not installed.
Any ideas? Perhaps a linker flag?
I presume that x64 build failure is a CRAN disqualification. This is the last hurdle, but seems like a big one.
C:.\EDM\rEDM_cpp_dev>R CMD INSTALL rEDMNew
In R CMD INSTALL
* installing to library './R/win-library/3.4'
* installing *source* package 'rEDMNew' ...
** libs
*** arch - i386
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c CCM.cpp -o CCM.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c ComputeError.cpp -o ComputeError.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c DataFrame.cpp -o DataFrame.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c Embed.cpp -o Embed.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c EmbedDim.cpp -o EmbedDim.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c Multiview.cpp -o Multiview.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c PredictInterval.cpp -o PredictInterval.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c PredictNL.cpp -o PredictNL.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c RcppEDMCommon.cpp -o RcppEDMCommon.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c SMap.cpp -o SMap.o
c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c Simplex.cpp -o Simplex.o
make[1]: Entering directory './src-i386/cppEDM/src'
c:/Rtools/mingw_32/bin/gcc -c Common.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c AuxFunc.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c DateTimeUtil.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c Parameter.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c Embed.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c Interface.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c Neighbors.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c Simplex.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c Eval.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c CCM.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c Multiview.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/gcc -c SMap.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_32/bin/ar -rcs libEDM.a Common.o AuxFunc.o DateTimeUtil.o Parameter.o Embed.o Interface.o Neighbors.o Simplex.o Eval.o CCM.o Multiview.o SMap.o
cp libEDM.a ../lib/
make[1]: Leaving directory './src-i386/cppEDM/src'
c:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o rEDMNew.dll tmp.def CCM.o ComputeError.o DataFrame.o Embed.o EmbedDim.o Multiview.o PredictInterval.o Pred
ictNL.o RcppEDMCommon.o RcppExports.o SMap.o Simplex.o -L./cppEDM/src/ -lEDM -LC:/PROGRA~1/R/R-34~1.4/bin/i386 -lR
installing to ./R/win-library/3.4/rEDMNew/libs/i386
*** arch - x64
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c CCM.cpp -o CCM.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c ComputeError.cpp -o ComputeError.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c DataFrame.cpp -o DataFrame.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c Embed.cpp -o Embed.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c EmbedDim.cpp -o EmbedDim.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c Multiview.cpp -o Multiview.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c PredictInterval.cpp -o PredictInterval.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c PredictNL.cpp -o PredictNL.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c RcppEDMCommon.cpp -o RcppEDMCommon.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c SMap.cpp -o SMap.o
c:/Rtools/mingw_64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-34~1.4/include" -DNDEBUG -I./cppEDM/src -I../ -I"./R/win-library/3.4/Rcpp/include" -O2 -Wall -mtune=generic -c Simplex.cpp -o Simplex.o
make[1]: Entering directory './src-x64/cppEDM/src'
c:/Rtools/mingw_64/bin/gcc -c Common.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c AuxFunc.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c DateTimeUtil.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c Parameter.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c Embed.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c Interface.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c Neighbors.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c Simplex.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c Eval.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c CCM.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c Multiview.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/gcc -c SMap.cc -Wa,-mbig-obj -std=c++11 -DCCM_THREADED -DMULTIVIEW_VALUES_OVERLOAD -I../
c:/Rtools/mingw_64/bin/ar -rcs libEDM.a Common.o AuxFunc.o DateTimeUtil.o Parameter.o Embed.o Interface.o Neighbors.o Simplex.o Eval.o CCM.o Multiview.o SMap.o
cp libEDM.a ../lib/
make[1]: Leaving directory './src-x64/cppEDM/src'
c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o rEDMNew.dll tmp.def CCM.o ComputeError.o DataFrame.o Embed.o EmbedDim.o Multiview.o PredictInterval.o Pred
ictNL.o RcppEDMCommon.o RcppExports.o SMap.o Simplex.o -L./cppEDM/src/ -lEDM -LC:/PROGRA~1/R/R-34~1.4/bin/x64 -lR
-- This is where it just grinds away...
Apologies if I've transgressed a social norm by editing this post. Seemed like a logical thing to do rather than starting a new one.
For example, lets take a default QT widget application that we get. So instead of using QT Creator if we want to build using the terminal then what is the way to do that?
Basically we want to produce the build for the project which actually also contains the dmg file.
Compile output when done using QT Creator shown is below when no change is done :
14:37:04: Running steps for project QTDefaultProj...
14:37:04: Configuration unchanged, skipping qmake step.
14:37:04: Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
14:37:05: The process "/usr/bin/make" exited normally.
14:37:05: Elapsed time: 00:00.
Compile Output after changing the directory :
15:31:50: Running steps for project QTDefaultProj...
15:31:50: Starting: "/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/qmake" /Users/arqam/Desktop/Junk/QTDefaultProj/QTDefaultProj.pro -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug
Info: creating stash file /Users/arqam/Desktop/Junk/build-QTDefaultProj-Desktop_Qt_5_10_0_clang_64bit-Debug-2/.qmake.stash
15:31:50: The process "/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/qmake" exited normally.
15:31:50: Starting: "/usr/bin/make" qmake_all
make: Nothing to be done for `qmake_all'.
15:31:51: The process "/usr/bin/make" exited normally.
15:31:51: Starting: "/usr/bin/make"
/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/uic ../QTDefaultProj/mainwindow.ui -o ui_mainwindow.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o main.o ../QTDefaultProj/main.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o mainwindow.o ../QTDefaultProj/mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -dM -E -o moc_predefs.h ../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/features/data/dummy.cpp
/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/moc -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -I/Users/arqam/Desktop/Junk/QTDefaultProj -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib ../QTDefaultProj/mainwindow.h -o moc_mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o moc_mainwindow.o moc_mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wl,-rpath,#executable_path/Frameworks -Wl,-rpath,/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o QTDefaultProj.app/Contents/MacOS/QTDefaultProj main.o mainwindow.o moc_mainwindow.o -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL
15:31:55: The process "/usr/bin/make" exited normally.
15:31:55: Elapsed time: 00:05.
With help from m7913d I am finally able to build the QT project from terminal without using QT Creator.
So steps are :
Create an empty folder name it as build-debug for example.
Inside your build-debug folder run the following command :
pathToQTDirectory/QT/5.10.0/clang_64/bin/qmake pathToQTProjectFolder/MyProject/
/usr/bin/make qmake_all
/usr/bin/make
If the above doesn't work then try seeing in the QT Creator compiler output the steps involved when you specify a new directory as the build directory.
I try to compile my app, QNX and Qt is all set.
in line 3.
C:/QNX650/target/qnx6armle-v7 is in the QNX_TARGET env var, and C:/QNX650/host/win32/x86 is QNX_HOST env var. this is strange they combine together.
Qtcreator, debug mode.this is the only output
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -g -Wall -W -D_REENTRANT -fPIE -DQT_NO_CLIPBOARD -DHMI_PLUGIN_DEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/mkspecs/qnx-armv7le-qcc -I../MQueue_Demo -I../MQueue_Demo/qtquick2applicationviewer -I../MQueue_Demo/depends/MQueue/include -I../MQueue_Demo/depends/MQueue/include/native -I../MQueue_Demo/depends/hmi_interfaces -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtQuick -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtQml -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtNetwork -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtGui -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtGui/5.0.2 -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtGui/5.0.2/QtGui -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtCore -I. -IC:\QNX650\target\qnx6\armle-v7/target/qnx6/usr/include -IC:\QNX650\target\qnx6\armle-v7/target/qnx6/usr/include/freetype2 -I. -o main.obj ../MQueue_Demo/main.cpp
cc: unknown target 'gcc_ntoarmv7le+debug'
cc: no targets defined in C:/QNX650/target/qnx6/armle-v7/host/win32/x86/etc/qcc!
make: *** [main.obj] Error 1
09:46:25: The process "C:\QNX650\host\win32\x86\usr\bin\make.exe" exited with code 2.
I’m compiling the Qt with phonon and phonon-backend for my embedded board.
I type:
./configure -embedded arm -xplatform qws/linux-arm-g++ -qt-mouse-tslib -L/home/user/ev-sdk/rootfs/arm-a8-fs/usr/lib -L/home/user/Desktop/qt-everywhere-opensource-src-4.8.1/lib -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include/freetype2/freetype/config -prefix /opt/qt_eng -little-endian -no-gif -no-libtiff -no-libmng -no-openssl -no-opengl -no-mmx -no-3dnow -no-sse -no-sse2 -no-largefile -no-sm -svg -v -no-feature-cursor -fast -opensource -release -no-multimedia -no-cups -no-nis -no-exceptions -nomake examples -nomake demos -no-sql-sqlite -no-g++-exceptions -phonon -phonon-backend -DQT_NO_QWS_CURSOR -DQT_THREAD_SUPPORT
with qmake.conf in /home/user/Desktop/qt-everywhere-opensource-src-4.8.1/mkspecs/qws/linux-arm-g++:
#
# qmake configuration for building with arm-linux-g++ #
include(../../common/gcc-base.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8
-mfpu=neon -mfloat-abi=softfp
DEFINES +=
# modifications to g++.conf
QMAKE_CC = sb2 -t imx53 gcc
QMAKE_CXX = sb2 -t imx53 g++
QMAKE_LINK = sb2 -t imx53 g++
QMAKE_LINK_SHLIB = sb2 -t imx53 g++
# modifications to linux.conf
QMAKE_AR = sb2 -t imx53 ar cqs
QMAKE_OBJCOPY = sb2 -t imx53 objcopy
QMAKE_STRIP = sb2 -t imx53 strip
load(qt_config)
If I remove -phonon -phonon-backend from option the compilation is successful.
If I put -phonon -phonon-backend
I have this error:
.
.
.
D-Bus auto-detection... ()
Project WARNING: Your mkspec is including 'common/g++.conf', but the mkspecs have been refactored
To fix this include 'common/gcc-base-.conf and 'common/g++-.conf' instead
sb2 -t imx53 g++ -c -pipe -pipe -pipe -pipe -pipe -pipe -O2 -O2 -O2 -O2 -O2 -O2 -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -I../../../mkspecs/qws/linux-arm-g++ -I. -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include/freetype2/freetype/config -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -o dbus.o dbus.cpp
dbus.cpp:43:23: error: dbus/dbus.h: No such file or directory
dbus.cpp:46:2: error: #error Needs at least dbus version 1
dbus.cpp: In function 'int main(int, char**)':
dbus.cpp:51: error: 'dbus_shutdown' was not declared in this scope
make: *** [dbus.o] Error 1
D-Bus disabled.
Glib auto-detection... ()
Project WARNING: Your mkspec is including 'common/g++.conf', but the mkspecs have been refactored
To fix this include 'common/gcc-base-.conf and 'common/g++-.conf' instead
sb2 -t imx53 g++ -c -pipe -pipe -pipe -pipe -pipe -pipe -O2 -O2 -O2 -O2 -O2 -O2 -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -Wall -W -I../../../mkspecs/qws/linux-arm-g++ -I. -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/include/freetype2/freetype/config -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -o glib.o glib.cpp
glib.cpp: In function 'int main(int, char**)':
glib.cpp:55: warning: 'pollfd' is used uninitialized in this function
sb2 -t imx53 g++ -Wl,-O1 -o glib glib.o -L/home/user/ev-sdk/rootfs/arm-a8-fs/usr/lib -L/home/user/Desktop/qt-everywhere-opensource-src-4.8.1/lib
*glib.o: In function `main':
glib.cpp:(.text+0x10): undefined reference to `g_thread_init'
glib.cpp:(.text+0x14): undefined reference to `g_main_context_default'
glib.cpp:(.text+0x20): undefined reference to `g_source_new'
glib.cpp:(.text+0x28): undefined reference to `g_source_add_poll'
glib.cpp:(.text+0x38): undefined reference to `g_threads_got_initialized'
collect2: ld returned 1 exit status
make: *** [glib] Error 1*
Glib disabled.
Phonon support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.
I lost the last two days to understand why giving error.
Could someone help me?
Debian/linux can use:
$ sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
The command can be run before run ./configure
QMAKE_LIBDIR += -L$${ROOTFS_DIR}/usr/lib
QMAKE_CFLAGS += -I$${ROOTFS_DIR}/usr/include/glib-2.0
QMAKE_CFLAGS += -I$${ROOTFS_DIR}/usr/lib/glib-2.0/include
QMAKE_LIBS += -lgthread-2.0 -lglib-2.0 -v
I have the same error than here. There's no solution there and also I'm gonna try to explain it more clearly so hopefully someone has the solution. Also I've installed everything from the answer to this question.
I'm trying to compile a program that a friend has done in QT (linux). I've tryed it on Windows and it runs just fine, the problem is that I can't run it on Ubuntu 11.10.
This is the compiling output at QT:
...
glwidget.o:glwidget.cpp:function GLWidget::resizeGL(int, int): error: undefined reference to 'gluOrtho2D'
glwidget.o:glwidget.cpp:function GLWidget::projectScene(): error: undefined reference to 'gluOrtho2D'
make: Leaving directory...
collect2: ld returned 1 exit status
make: *** [QTapplication] Error 1
...
glu.h and gl.h are #included.
QT += opengl is put at the .pro
I don't know if it's problem of Ubuntu 11.10. I've read that it has some problems with the linker though I downloaded "binutils-gold" that supposedly fixed it. Also I've tryed to add manually the library with right click over the projects' .pro->Add Librarys, but it won't let me add nothing at "/usr/include/GL".
Finally, here's the complete compile output:
make: Entering directory `/home/daniel/Escritorio/Practica3-build-desktop-Desktop_Qt_4_8_0_for_GCC__Qt_SDK__Release'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/linux-g++ -I../Practica3 -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtOpenGL -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include -I../Practica3/SceneObjects -I../Practica3/SceneObjects/Auxiliar -I/usr/X11R6/include -I. -I. -I../Practica3 -I. -o main.o ../Practica3/main.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/linux-g++ -I../Practica3 -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtOpenGL -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include -I../Practica3/SceneObjects -I../Practica3/SceneObjects/Auxiliar -I/usr/X11R6/include -I. -I. -I../Practica3 -I. -o mainwindow.o ../Practica3/mainwindow.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/linux-g++ -I../Practica3 -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtOpenGL -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include -I../Practica3/SceneObjects -I../Practica3/SceneObjects/Auxiliar -I/usr/X11R6/include -I. -I. -I../Practica3 -I. -o glwidget.o ../Practica3/glwidget.cpp
../Practica3/glwidget.cpp:120:6: warning: unused parameter 'event' [-Wunused-parameter]
/home/daniel/QtSDK/Desktop/Qt/4.8.0/gcc/bin/moc -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/linux-g++ -I../Practica3 -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtOpenGL -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include -I../Practica3/SceneObjects -I../Practica3/SceneObjects/Auxiliar -I/usr/X11R6/include -I. -I. -I../Practica3 -I. ../Practica3/mainwindow.h -o moc_mainwindow.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/linux-g++ -I../Practica3 -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtOpenGL -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include -I../Practica3/SceneObjects -I../Practica3/SceneObjects/Auxiliar -I/usr/X11R6/include -I. -I. -I../Practica3 -I. -o moc_mainwindow.o moc_mainwindow.cpp
/home/daniel/QtSDK/Desktop/Qt/4.8.0/gcc/bin/moc -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/linux-g++ -I../Practica3 -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtOpenGL -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include -I../Practica3/SceneObjects -I../Practica3/SceneObjects/Auxiliar -I/usr/X11R6/include -I. -I. -I../Practica3 -I. ../Practica3/glwidget.h -o moc_glwidget.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/4.8.0/gcc/mkspecs/linux-g++ -I../Practica3 -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include/QtOpenGL -I../../QtSDK/Desktop/Qt/4.8.0/gcc/include -I../Practica3/SceneObjects -I../Practica3/SceneObjects/Auxiliar -I/usr/X11R6/include -I. -I. -I../Practica3 -I. -o moc_glwidget.o moc_glwidget.cpp
g++ -Wl,-O1 -Wl,-rpath,/home/daniel/QtSDK/Desktop/Qt/4.8.0/gcc/lib -o Practica3 main.o mainwindow.o glwidget.o scene.o pv2d.o regularpolygon.o obstacle.o sceneobject.o rectangle.o paintableobject.o segment.o point.o pen.o bouncingball.o circle.o moc_mainwindow.o moc_glwidget.o -L/home/daniel/QtSDK/Desktop/Qt/4.8.0/gcc/lib -L/usr/X11R6/lib -lQtOpenGL -lQtGui -lQtCore -lGL -lpthread
glwidget.o:glwidget.cpp:function GLWidget::resizeGL(int, int): error: undefined reference to 'gluOrtho2D'
make: Leaving directory `/home/daniel/Escritorio/Practica3-build-desktop-Desktop_Qt_4_8_0_for_GCC__Qt_SDK__Release'
glwidget.o:glwidget.cpp:function GLWidget::projectScene(): error: undefined reference to 'gluOrtho2D'
collect2: ld returned 1 exit status
make: *** [Practica3] Error 1
16:44:35: The process "/usr/bin/make" exited with code 2.
Error while building project Practica3 (target: Desktop)
When executing build step 'Make'
You need to add the relevant libraries to the linker options.
Libraries are added with -l options (lower-case L). They are not paths, but actual files that contain code. On Linux, those files have .so* extensions. On Windows, those are .dll files. Extensions vary on other platforms.
One of the questions you link states that you need the following libraries:
-lglut -lGL -lGLU -lGLEW
(gluOrtho2D is actually in libGLU, but you might be missing others.)
Read your IDE's docs to see how you're supposed to add those to the linker options, but many allow you to enter them just like that in the right area of the project settings.
If those libraries are not in the usual library paths on your machine (/lib, /usr/lib on Linux, possibly /lib64 and /usr/lib64, or same with 32 instead), you'll have to tell the linker to look in other directories.
For that, either your IDE has another option for linker search paths, or you can specify them in the same spot as the actual libraries. You use the -L switch for that.
-L for search paths, -l for libraries.
Recap: if you want to link with libsuperfoo.so that is in /usr/local/bar/libs, then the correct linker options are:
-L/usr/local/bar/libs -lsuperfoo
If you're using qmake, the only thing you need to add to the .pro file is (for the above hypothetical library):
LIBS += -L/usr/local/bar/libs -lsuperfoo
In windows, adding
LIBS += -lopengl32 -lglu32
in the .pro file and
#include<GL/glu.h>
in the source file solves the issue.