Installation of Qt Messaging framework in mac? - qt

Can some one explain the steps that are needed to include Messaging framework in to a Qt Application?
I have downloaded the Open source Project that contains the Messaging framework from this link:
http://get.qt.nokia.com/qt/solutions/qt-mobility-opensource-src-1.1.0-beta2.tar.gz
UPDATE:
Raised a bug with Nokia.
http://bugreports.qt.nokia.com/browse/QTSDK-229
Running build steps for project
writemessage... Configuration
unchanged, skipping qmake step.
Starting: "/usr/bin/make" -w make:
Entering directory
/Users/xxxxxxx/Qt/qt-mobility-opensource-src-1.1.0-beta2/examples/writemessage-build-simulator'
g++ -c -pipe -g -gdwarf-2 -arch x86_64
-Xarch_x86_64 -mmacosx-version-min=10.5 -arch ppc -arch i386 -Wall -W -DQT_NO_PRINTER -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../NokiaQtSDK/Simulator/Qt/gcc/mkspecs/macx-g++
-I../writemessage -I../../../../NokiaQtSDK/Simulator/Qt/gcc/lib/QtCore.framework/Versions/4/Headers
-I../../../../NokiaQtSDK/Simulator/Qt/gcc/include/QtCore
-I../../../../NokiaQtSDK/Simulator/Qt/gcc/lib/QtGui.framework/Versions/4/Headers
-I../../../../NokiaQtSDK/Simulator/Qt/gcc/include/QtGui
-I../../../../NokiaQtSDK/Simulator/Qt/gcc/include
-I/Users/xxxxxxx/NokiaQtSDK/Simulator/Qt/gcc/include/QtMessaging
-I/Users/xxxxxxx/NokiaQtSDK/Simulator/Qt/gcc/include/QtMobilitySimulator
-I../../src/global -I../../src/messaging -I/Users/xxxxxxx/install/include -I/Users/xxxxxxx/install/include/QtMobility
-I/Users/xxxxxxx/install/include/QtMessaging
-I../../../../Build/Debug/writemessage/moc
-I. -F/Users/xxxxxxx/NokiaQtSDK/Simulator/Qt/gcc/lib
-o ../../../../Build/Debug/writemessage/messagesender.o
../writemessage/messagesender.cpp g++
-headerpad_max_install_names -arch x86_64 -Xarch_x86_64
-mmacosx-version-min=10.5 -arch ppc -arch i386 -o writemessage.app/Contents/MacOS/writemessage
../../../../Build/Debug/writemessage/messagesender.o
../../../../Build/Debug/writemessage/main.o
../../../../Build/Debug/writemessage/moc_messagesender.o
-F/Users/xxxxxxx/NokiaQtSDK/Simulator/Qt/gcc/lib
-L/Users/xxxxxxx/NokiaQtSDK/Simulator/Qt/gcc/lib
-F/Users/xxxxxxx/lib -L/Users/xxxxxxx/lib -framework Message
-F/Users/xxxxxxx/install/Library/Frameworks
-L/Users/xxxxxxx/install/Library/Frameworks
-framework QtMobilitySimulator -framework QtMessaging -framework QtGui
-L/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib -F/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib -framework QtNetwork -framework QtCore ld: warning: directory
'/Users/xxxxxxx/install/Library/Frameworks'
following -L not found ld: warning:
directory
'/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib'
following -L not found ld: warning:
directory
'/Users/xxxxxxx/install/Library/Frameworks'
following -F not found ld: warning:
directory
'/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib'
following -F not found ld: framework
not found QtMobilitySimulator
collect2: ld returned 1 exit status
ld: warning: directory
'/Users/xxxxxxx/install/Library/Frameworks'
following -L not found ld: warning:
directory
'/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib'
following -L not found ld: warning:
directory
'/Users/xxxxxxx/install/Library/Frameworks'
following -F not found ld: warning:
directory
'/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib'
following -F not found ld: framework
not found QtMobilitySimulator
collect2: ld returned 1 exit status
ld: warning: directory
'/Users/xxxxxxx/install/Library/Frameworks'
following -L not found ld: warning:
directory
'/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib'
following -L not found ld: warning:
directory
'/Users/xxxxxxx/install/Library/Frameworks'
following -F not found ld: warning:
directory
'/Installer/______BUILD______PADDED______/ndk/Simulator/Qt/gcc/lib'
following -F not found ld: framework
not found QtMobilitySimulator
collect2: ld returned 1 exit status
lipo: can't open input file:
/var/folders/CP/CP8sR5YZGx0b2xA2gYP5YE+++TI/-Tmp-//ccoxcfz2.out
(No such file or directory) make: ***
[writemessage.app/Contents/MacOS/writemessage]
Error 1 make: Leaving directory
/Users/xxxxxxx/Qt/qt-mobility-opensource-src-1.1.0-beta2/examples/writemessage-build-simulator'
The process "/usr/bin/make" exited
with code %2. Error while building
project writemessage (target: Qt
Simulator) When executing build step
'Make'

Add this to your .pro file:
macx {
LIBS += -framework Message
}
And include headers this way:
#include <Message/MessageExport.h>
This should work with Qt 4.7.

Related

Linking error for RInside on Mac OS X 11.6 (Big Bur): pcre2-8 library not found

This is likely an error installing PCRE2 (which I did using "sudo port install pcre2"), but when I "make" sample code for RInside, I get:
$ make rinside_sample0
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include -I/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RInside/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include rinside_sample0.cpp -L/usr/local/lib -F/Library/Frameworks/R.framework/.. -framework R -L/usr/local/lib -lpcre2-8 -llzma -lbz2 -lz -licucore -ldl -lm -liconv -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/Library/Frameworks/R.framework/Resources/lib -lRlapack /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RInside/lib/libRInside.a -o rinside_sample0
In file included from rinside_sample0.cpp:10:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RInside/include/RInside.h:26:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RInside/include/RInsideCommon.h:38:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp.h:57:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/Rcpp/DataFrame.h:136:18: warning: unused variable 'data'
[-Wunused-variable]
SEXP data = Parent::get__();
^
1 warning generated.
ld: library not found for -lpcre2-8
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [rinside_sample0] Error 1
$
Thank you for the comment, Dirk. You got me pointed in the correct direction. I had two old versions of code: pcre2 and Rcpp.
I followed the directions for installing the latest version of "pcre2" here: https://izziswift.com/how-to-install-pcre-development-headers-on-mac-osx/.
I downloaded "pcre" version 10.39, cd'd to that directory, ran:
./configure
make
make install
After that, the examples in RInside compiled, but I got a runtime error:
$ ./rinside_sample0
Error: function 'Rcpp_precious_remove' not provided by package 'Rcpp'
Execution halted
$
Some searching showed that error arose from running an older version (1.0.6) of "Rcpp". I went into RStudio, typed "install.packages("Rcpp")" to update to version 1.0.7 and now everything runs!
Hopefully going through these steps will help anyone else who encounters these problems.

rJava package installation on Mac 10.14

I’m running into issues while trying to install the rJava package on my Mac. I have tried the solutions proposed online, including running R CMD javareconf, but without success (output is below). Any advice on how to fix this issue would be much appreciated.
Among the things I tried is the solution proposed here: rJava installation fails on macOS 10.14
open macOS_SDK_headers_for_macOS_10.14.pkg```
This had worked for me with my previous Mac, but not this time.
Output of:
```sudo R CMD javareconf```
Java interpreter : /usr/bin/java
Java version : 12.0.2
Java home path : /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
/usr/local/Cellar/gcc/9.1.0/bin/gcc-9 -I"/usr/local/Cellar/r/3.6.1/lib/R/include" -DNDEBUG -I/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/include/darwin -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -fPIC -g -O2 -c conftest.c -o conftest.o
/usr/local/Cellar/gcc/9.1.0/bin/gcc-9 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/3.6.1/lib/R/lib -L/usr/local/Cellar/gcc/9.1.0/lib -o conftest.so conftest.o -L/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/lib/server -ljvm -L/usr/local/Cellar/r/3.6.1/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
ld: library not found for -lintl
collect2: error: ld returned 1 exit status
make: *** [conftest.so] Error 1
Unable to compile a JNI program
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /usr/local/Cellar/r/3.6.1/lib/R
Done.

How do I build sqlite with static library also be compiled with -fPIC?

I have compiled using below parameters
#./configure --prefix=/usr/local CFLAGS=-fPIC --enable-static --enable-shared \
CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 \
-DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
-DSQLITE_SECURE_DELETE=1 \
-DSQLITE_ENABLE_DBSTAT_VTAB=1"
# make -j 8
# make install
After using sqlite I get below error message:
/usr/bin/g++ -o utools/utools.so -Wl,-Bsymbolic -g -O2 -shared -Wl,-z,defs utools/utools.plugin.o utools/lib/libutools.a core/lib/libunv.a fv/lib/libfv.a sb/lib/libsb.a -lz -ldl
/usr/bin/ld: /usr/local/sqlite/lib/libsqlite3.a(sqlite3.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/sqlite/lib/libsqlite3.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
scons: *** [stdarm/stdarm.so] Error 1
scons: building terminated because of errors.
inside /usr/local/lib/ directory, deleting following files worked for me
libsqlite3.a
libsqlite3.la
libsqlite3.o.0.bak
libsqlite3.so
I think these files are from the older versions of libsqlite3,
because when you type and check dpkg -L libsqlite3-dev, none goes to /usr/local/lib/
I took the reference from sqlite3 breakage

Compilation error with cpp in R

I recently "upgraded" to XCode 5.2 and now a number of R packages will not work. I have a 15" MBP running OSX Mavericks 10.9.1 and am running R 3.0.2.
First, the mcmc function in the package diversitree broke and gave the following error:
Error in .External(list(name = "CppMethod__invoke_notvoid", address = <pointer: 0x0>, :
NULL value passed as symbol address
Furthermore, I cannot compile the package "geomorph" from source, and I get the following error:
clang: error: no such file or directory: 'SHLIB_LIBADD'
clang: error: no such file or directory: '='
make: *** [geomorph.so] Error 1
ERROR: compilation failed for package ‘geomorph’
So I believe the error is somewhere in the compilers. I tested this idea with:
> require(Rcpp)
> evalCpp("1+1")
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Users/Chris/Library/R/3.0/library/Rcpp/include" -fPIC "-mtune=native -g -O2 -Wall -pedantic -Wconversion" -c file177c642d0b53.cpp -o file177c642d0b53.o clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -L/usr/local/lib -o sourceCpp_1783.so file177c642d0b53.o /Users/Chris/Library/R/3.0/library/Rcpp/lib/libRcpp.a SHLIB_LIBADD = -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
Error in sourceCpp(code = code, env = env, rebuild = rebuild, showOutput = showOutput, :
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please install Command Line Tools for XCode (or equivalent).
clang: error: no such file or directory: 'SHLIB_LIBADD'
clang: error: no such file or directory: '='
make: *** [sourceCpp_1783.so] Error 1
Also this:
has_devel()
'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla \
CMD SHLIB foo.c
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -fPIC "-mtune=native -g -O2 -Wall -pedantic -Wconversion" -c foo.c -o foo.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -L/usr/local/lib -o foo.so foo.o SHLIB_LIBADD = -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
clang: error: no such file or directory: 'SHLIB_LIBADD'
Error: Command failed (1)
clang: error: no such file or directory: '='
make: *** [foo.so] Error 1
I tried reinstalling Rcpp from source and that fails too:
clang: error: no such file or directory: 'SHLIB_LIBADD'
clang: error: no such file or directory: '='
make: *** [Rcpp.so] Error 1
I've spent hours now trying to troubleshoot this and I've run across numerous mentions of editing the Makeconf file to add clang. I have done this but still cannot get things that use C in R to work. I would greatly appreciate any help.
Are you using a CRAN-provided binary of R, or your own compiled version of R? Did you compile R with your new XCode compilers or the old ones?
My experience is that CRAN-R will work fine with a specific compiler toolchain, as long as you use the same toolchain for all the packages you compile. If you, for example, try to link a new-XCode compiled package to an old-XCode compiled Rcpp, you will have problems.
Your SHLIB_LIBADD error, as far as I can guess, says you did something weird in your Makevars or Makeconf and now things are going wrong in parsing the files. I'd be curious to see if you can reproduce this with a fresh, CRAN-provided R.
Can you reproduce the problem if you try to re-install R + all your packages? You should try re-installing R with a fresh library directory, and then re-installing these problematic packages, and going from there.

Unable to compile thrift-0.9.0 on Centos6.4

I have followed all the instructions mentioned in the Apache thrift wiki. I downloaded the thrift source code, then installed the dependencies
sudo yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel
Then ran
./configure
(didn't run bootstrap.sh because there is no bootstrap.sh in the thrift-0.9.0 codebase). Finally, I get this error. Any idea why this is happening?
libtool: link: ( cd ".libs" && rm -f "libthriftz.la" && ln -s "../libthriftz.la" "libthriftz.la" )
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/include -I./src -I./src/thrift -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtNetwork -Wall -g -O2 -MT libthriftqt_la-moc_TQTcpServer.lo -MD -MP -MF .deps/libthriftqt_la-moc_TQTcpServer.Tpo -c -o libthriftqt_la-moc_TQTcpServer.lo `test -f 'src/thrift/qt/moc_TQTcpServer.cpp' || echo './'`src/thrift/qt/moc_TQTcpServer.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/include -I./src -I./src/thrift -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtNetwork -Wall -g -O2 -MT libthriftqt_la-moc_TQTcpServer.lo -MD -MP -MF .deps/libthriftqt_la-moc_TQTcpServer.Tpo -c src/thrift/qt/moc_TQTcpServer.cpp -fPIC -DPIC -o .libs/libthriftqt_la-moc_TQTcpServer.o
src/thrift/qt/moc_TQTcpServer.cpp:14:2: error: #error "This file was generated using the moc from 4.8.1. It"
src/thrift/qt/moc_TQTcpServer.cpp:15:2: error: #error "cannot be used with the include files from this version of Qt."
src/thrift/qt/moc_TQTcpServer.cpp:16:2: error: #error "(The moc has changed too much.)"
src/thrift/qt/moc_TQTcpServer.cpp:47: error: no 'void apache::thrift::async::TQTcpServer::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)' member function declared in class 'apache::thrift::async::TQTcpServer'
src/thrift/qt/moc_TQTcpServer.cpp:62: error: 'const QMetaObjectExtraData apache::thrift::async::TQTcpServer::staticMetaObjectExtraData' is not a static member of 'class apache::thrift::async::TQTcpServer'
src/thrift/qt/moc_TQTcpServer.cpp:63: error: 'qt_static_metacall' was not declared in this scope
src/thrift/qt/moc_TQTcpServer.cpp:64: error: too many initializers for 'const QMetaObjectExtraData'
src/thrift/qt/moc_TQTcpServer.cpp:68: error: 'staticMetaObjectExtraData' was not declared in this scope
src/thrift/qt/moc_TQTcpServer.cpp:69: error: too many initializers for 'QMetaObject::<anonymous struct>'
src/thrift/qt/moc_TQTcpServer.cpp: In member function 'virtual int apache::thrift::async::TQTcpServer::qt_metacall(QMetaObject::Call, int, void**)':
src/thrift/qt/moc_TQTcpServer.cpp:95: error: 'qt_static_metacall' was not declared in this scope
make[4]: *** [libthriftqt_la-moc_TQTcpServer.lo] Error 1
make[4]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0/lib/cpp'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0/lib/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0'
make: *** [all] Error 2
I download the source from: http://www.apache.org/dyn/closer.cgi?path=/thrift/0.9.0/thrift-0.9.0.tar.gz
Your qt-devel is out of date for thrift. Just remove the qt-devel rpm and rerun the configure script which will skip this part. It works for me.
First of all, check your qt related rpms by executing the following command
rpm -qa | grep qt-devel
If you find qt-devel is installed version below 4.6, please remove this package by executing command
rpm -qa | grep qt-devel | xargs rpm -e
If this is done, the qt part of thrift will be skipped.
It looks like the version of Qt that is on your system is older than what this program expects. Can you try updating Qt to a later version?
sudo yum install qt4-devel

Resources