Compiling QSerialPort on OSX SnowLeopard and QT 4.8 - c++

I installed qt 4.8 on my Osx Snow Leopard, I had cloned QtSerialPort from git://gitorious.org/qt/qtserialport.git and then I tried to build it in QtCreator.
When I try to build the library I am receiving the following error:
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp:62:34: error: private/qcore_unix_p.h: No such file or directory
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp: In member function 'bool QSerialPortPrivate::open(QFlags)':
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp:218: error: 'qt_safe_open' was not declared in this scope
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp: In member function 'void QSerialPortPrivate::close()':
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp:309: error: 'qt_safe_close' was not declared in this scope
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp: In member function 'qint64 QSerialPortPrivate::readFromPort(char*, qint64)':
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp:1081: error: 'qt_safe_read' was not declared in this scope
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp: In member function 'qint64 QSerialPortPrivate::writeToPort(const char*, qint64)':
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp:1097: error: 'qt_safe_write' was not declared in this scope
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp: In member function 'qint64 QSerialPortPrivate::writePerChar(const char*, qint64)':
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp:1134: error: 'qt_safe_write' was not declared in this scope
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp: In member function 'qint64 QSerialPortPrivate::readPerChar(char*, qint64)':
/Users/warcomeb/Projects/External/qserial/qtserialport/src/serialport/qserialport_unix.cpp:1160: error: 'qt_safe_read' was not declared in this scope
make[2]: * [qserialport_unix.o] Error 1
make[1]: * [sub-serialport-make_default] Error 2
make: * [sub-src-make_default-ordered] Error 2
14:45:11: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project qtserialport (kit: Desktop)
Could you please help me with this?

Repository was recently breaked for Qt 4. Please wait for fix ( https://codereview.qt-project.org/#change,77978 ) merged and then update your clone.

Basically as Sergey wrote.
I accidentally approved two changes from someone else without testing the change on Qt 4 and contributors usually test the patches only against Qt 5, except us.
Once I realized that it would break the repository, I submitted a revert for those changes, and then I re-pushed the change with some fixes to work with both Qt 4 and 5.
This should now be fixed both in the "stable" (default) and "dev" branch, so all you need to do is git pull to get in unbroken again.

Related

R: Compilation error "ISO C++ forbids in-class initialization of non-const static member" when installing feather package

I'm using R version 3.1.2 and want to install the "feather" package in RStudio:
install.packages("feather", type="source")
Using a source version because there doesn't seem to be a binary version.
It does extract the file and checks for MD5 sums correctly, but throws errors for several sub-steps:
error: ISO C++ forbids in-class initialization of non-const static member 'xy'
Here's an extract of what exactly RStudio tells me:
from c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/algorithm:63,
from ./feather/buffer.h:18,
from ./feather/metadata.h:23,
from ./feather/reader.h:21,
from feather/feather-c.cc:21:
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:196:57: error: ISO C++ forbids in-class initialization of non-const static member 'is_specialized'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:201:48: error: ISO C++ forbids in-class initialization of non-const static member 'digits'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:204:50: error: ISO C++ forbids in-class initialization of non-const static member 'digits10'
...(for many other parts)...
(also for some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1587:58: note: 'bool std::numeric_limits::has_quiet_NaN' is not const
(and:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1607:51: error: the value of 'std::numeric_limits::has_infinity' is not usable in a constant expression
(then some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/bits/random.tcc:345:7: error: '_M_x' was not declared in this scope
(and finally:)
confused by earlier errors, bailing out
make: *** [feather/feather-c.o] Error 1
Warnung: Ausführung von Kommando 'make -f "Makevars" -f "C:/PROGRA~1/R/R-31~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.2/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="feather.dll" OBJECTS="RcppExports.o feather-read.o feather-types.o feather-write.o"' ergab Status 2
ERROR: compilation failed for package 'feather'
* removing 'C:/Users/.../R/win-library/3.1/feather'
* restoring previous 'C:/Users/.../R/win-library/3.1/feather'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" CMD INSTALL -l "C:\Users...\R\win-library\3.1" C:\Users...\AppData\LocalTemp\RtmpKsxa73/downloaded_packages/feather_0.3.2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘feather’ had non-zero exit status
I wanted to install the feather-package via CRAN. It doesn't work in RStudio, nor does it in the R console. Running this on Windows 8.1.
Anybody have an idea why this won't install?
To me the problem lies somewhere with the package?
Or could it be a problem with authorization (I do not have administrative rights with my user, but I can install anything in C:\Users\my_user)
This specific language feature was first supported in GCC 4.7. You have GCC 4.6.3.
You will need to acquire a newer GCC or Clang installation.
If I read the error message correctly, you got your GCC from RTools 3.1. Looking at the project page for Rtools, Rtools 3.3 and up default to GCC 4.9 and up, which should support the code used by your feather extension.

how to change source code in opencv?

I am trying to change the opencv svm predict function by passing an extra variable called std::pair & ,so that I can get the class label as well as decision function value from that function. I have change the source code in /home/rakib/opencv-2.4.9/modules/ml/src/svm.cpp and also add the function declaration in header file. The problem is that when I rebuild opencv I got the following error.
Scanning dependencies of target opencv_python
[ 75%] Building CXX object modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o
In file included from /home/rakib/opencv-2.4.9/modules/python/src2/cv2.cpp:1129:0:
/home/rakib/opencv-2.4.9/build/modules/python/pyopencv_generated_types.h: In function ‘PyObject* pyopencv_CvSVM_predict(PyObject*, PyObject*, PyObject*)’:
/home/rakib/opencv-2.4.9/build/modules/python/pyopencv_generated_types.h:4878:5: error: ‘pair_double_and_double’ was not declared in this scope
pair_double_and_double labConCount;
^
/home/rakib/opencv-2.4.9/build/modules/python/pyopencv_generated_types.h:4878:28: error: expected ‘;’ before ‘labConCount’
pair_double_and_double labConCount;
^
/home/rakib/opencv-2.4.9/build/modules/python/pyopencv_generated_types.h:4885:40: error: ‘labConCount’ was not declared in this scope
pyopencv_to(pyobj_labConCount, labConCount, ArgInfo("labConCount", 0)) &&
^
make[2]: *** [modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o] Error 1
make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
make: *** [all] Error 2
Though I want to change the c++ code of opencv but it some how related to python opencv interface so far I understood.
So any help to fix this problem is greatly appreciated.
If you change the source and would like to see the change in python as well, you'll also need to regenerate the python bindings.
See here for more details.
The problem is solved by using cmake -D BUILD_NEW_PYTHON_SUPPORT=OFF

Compiling QTermWidget

I've tried to compile this custom QT widget to provide a terminal that I can embed into my application. I've compiled/installed the build tools for the program that I needed before Cmake would complete, but the make step is throwing errors that google hasn't been too helpful on:
[ 50%] Building CXX object CMakeFiles/qtermwidget5.dir/lib/kpty.cpp.o
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:506:26: error: no member named 'ut_name' in 'utmpx'
strncpy(l_struct.ut_name, user, sizeof(l_struct.ut_name));
~~~~~~~~ ^
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:506:57: error: no member named 'ut_name' in 'utmpx'
strncpy(l_struct.ut_name, user, sizeof(l_struct.ut_name));
~~~~~~~~ ^
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:617:20: error: no member named 'ut_name' in 'utmpx'
memset(ut->ut_name, 0, sizeof(*ut->ut_name));
~~ ^
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:617:44: error: no member named 'ut_name' in 'utmpx'
memset(ut->ut_name, 0, sizeof(*ut->ut_name));
~~ ^
4 errors generated.
make[2]: *** [CMakeFiles/qtermwidget5.dir/lib/kpty.cpp.o] Error 1
make[1]: *** [CMakeFiles/qtermwidget5.dir/all] Error 2
make: *** [all] Error 2
Does anyone have a solution to this problem?
And as an extension, how exactly does one effectively include a custom widget as to be usable in QT Creator?
http://pubs.opengroup.org/onlinepubs/7908799/xsh/utmpx.h.html
It looks like it doesn't include ut_name in the stock version of utmpx.h.
If you look at this version of it:
https://code.woboq.org/kde/include/bits/utmp.h.html
They have a "backwards compatibility hack" in there:
87 /* Backwards compatibility hacks. */
88 #define ut_name ut_user
You may want to upgrade that library that includes that header. Or just insert that #define in your code. And as a good github citizen, if it works, you should do a pull request and/or submit an issue about it so that the next person using that library doesn't run into the same issue.
Hope that helps.
I don't know why the problem happened, since according to all the files I checked everything was named properly.
Adding #define ut_user ut_name to kpty.h solved the problem though.

Unexpected behavior of make -I [duplicate]

I've tried to compile this custom QT widget to provide a terminal that I can embed into my application. I've compiled/installed the build tools for the program that I needed before Cmake would complete, but the make step is throwing errors that google hasn't been too helpful on:
[ 50%] Building CXX object CMakeFiles/qtermwidget5.dir/lib/kpty.cpp.o
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:506:26: error: no member named 'ut_name' in 'utmpx'
strncpy(l_struct.ut_name, user, sizeof(l_struct.ut_name));
~~~~~~~~ ^
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:506:57: error: no member named 'ut_name' in 'utmpx'
strncpy(l_struct.ut_name, user, sizeof(l_struct.ut_name));
~~~~~~~~ ^
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:617:20: error: no member named 'ut_name' in 'utmpx'
memset(ut->ut_name, 0, sizeof(*ut->ut_name));
~~ ^
/Users/a7c/qtermwidget/qtermwidget-master/lib/kpty.cpp:617:44: error: no member named 'ut_name' in 'utmpx'
memset(ut->ut_name, 0, sizeof(*ut->ut_name));
~~ ^
4 errors generated.
make[2]: *** [CMakeFiles/qtermwidget5.dir/lib/kpty.cpp.o] Error 1
make[1]: *** [CMakeFiles/qtermwidget5.dir/all] Error 2
make: *** [all] Error 2
Does anyone have a solution to this problem?
And as an extension, how exactly does one effectively include a custom widget as to be usable in QT Creator?
http://pubs.opengroup.org/onlinepubs/7908799/xsh/utmpx.h.html
It looks like it doesn't include ut_name in the stock version of utmpx.h.
If you look at this version of it:
https://code.woboq.org/kde/include/bits/utmp.h.html
They have a "backwards compatibility hack" in there:
87 /* Backwards compatibility hacks. */
88 #define ut_name ut_user
You may want to upgrade that library that includes that header. Or just insert that #define in your code. And as a good github citizen, if it works, you should do a pull request and/or submit an issue about it so that the next person using that library doesn't run into the same issue.
Hope that helps.
I don't know why the problem happened, since according to all the files I checked everything was named properly.
Adding #define ut_user ut_name to kpty.h solved the problem though.

Sphinix GUI trainer Failed to compile

i am trying to create ASR system for my native language called amharic and my plan is to make an aquastic model without toomuch effort. for that i thought i could use ASTRA(Advanced Sphinix Trainer ) which is made using QT. but the thing is there is only source code , no compiled binaries and wheni try to compile it using QT 5.1 mingw (X64) i get this errors .
S:\Lite\astra\audio_play.cpp:-1: In member function 'void audio_play::pause()':
S:\Lite\astra\audio_play.cpp:31: error: 'SIGSTOP' was not declared in this scope
S:\Lite\astra\audio_play.cpp:31: error: 'kill' was not declared in this scope
S:\Lite\astra\audio_play.cpp:38: error: 'SIGCONT' was not declared in this scope
S:\Lite\astra\audio_play.cpp:38: error: 'kill' was not declared in this scope
S:\Lite\astra\audio_play.cpp:-1: In member function 'void audio_play::stop_record()':
S:\Lite\astra\audio_play.cpp:50: error: 'kill' was not declared in this scope
Source code location of ASTRA -- AStra Trainer