Quantcast
Channel: Qt DevNet forums: Installation and Deployment
Viewing all articles
Browse latest Browse all 2113

Qt + GCC 4.9 Macports + openmp (MAC - Mavericks)

$
0
0
Hi all, if someone could help me because it’s the first time i’m using Qt and i’m trying to configure Qt to use in a OpenCV project which uses also openmp, i want to use this tool to develop a cross platform GUI . step 1) To use OpenMP on Mavericks i used macports which installed GCC 4.9 (gdb too) into /opt/local/bin /lib /inlcude step 2)I downloaded and installed QT, it installed the Kit with QT 5.2.1 clang 64 bit. step 3) i added the -fopenmp to the compiler and the linker The .pro file is the following: TEMPLATE = app CONFIG += console CONFIG -= app_bundle CONFIG -= qt INCLUDEPATH += /opt/local/lib QMAKE_CXXFLAGS += -fopenmp QMAKE_LFLAGS += -fopenmp QMAKE_CXXFLAGS+=-std=c++11 SOURCES += main.cpp step 4) I created a Manual Compiler configuration in the Compilers tab, which points to /opt/local/bin/g++-mp-4.9 and a Debuggers configuration too which points to /opt/local/bin/ggdb. step 5) i created in the Manual kit tab a custom one: Device type: Desktop Device: Local PC Sysroot: empty Compiler: GCC 4.9 (the one created manually inside the Compilers tab) Debugger: GGDB (the one created manually inside the Devuggers tab) QT version: the only available seems to be Qt 5.2.1 clang 64bit ERROR 1: There is a red alert icon next to the Kits i created which disappears when i turn off the Qt version setting it to None (but i need to use it). ERROR 2: compile output: Starting: "/opt/local/bin/gmake" /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -c -pipe -fopenmp -std=c++11 -g -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.6 -Wall -W -fPIE  -I../../../../Qt/5.2.1/clang_64/mkspecs/macx-g++ -I../OpenCV1 -I/opt/local/lib -I. -o main.o ../OpenCV1/main.cpp Seems that even if i configured to use the g++ inside the opt/ folder it is not used and the Xcode one is always used. Build Steps about qmake: qmake /Users/Neogene/Documents/Lavori/QT/OpenCV1/OpenCV1.pro -r -spec macx-g++ CONFIG+=debug CONFIG+=x86 Make: Override /usr/bin/make: /opt/local/bin/gmake ERROR 3: the autocomplete exposes the correct path of the #include <omp.h> but when compiling it doesn’t find the omp.h file, maybe this is due the the wrong compiler used (the Xcode one vs the GCC macports one) #include <iostream> #include <omp.h> using namespace std; int main() { cout << “Hello World QT!” << endl; return 0; } Somebody could tell me why? thank you in advance.

Viewing all articles
Browse latest Browse all 2113

Trending Articles