proton / zNotes

zNotes is a lightweight cross-platform application for notes management.
https://znotes.sourceforge.net
Other
18 stars 9 forks source link

zNotes can not compile x86_64 & GCC 4.7.0 #2

Closed alium closed 12 years ago

alium commented 12 years ago

Hallo!

First thank you for the best notes in Qt - znotes :-)

I have problem to compile, on x86_64 Linux & GCC 4.7.0 & QT 4.8.1:


g++ -c -m64 -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wall -W -D_REENTRANT -DNOTE_TODO_FORMAT -DVERSION=\"0.4.5\" -DPROGRAM_DATA_DIR=\"/usr/share/znotes/\" -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include -Ibuild -Ibuild -o build/note_todo.o note_todo.cpp single_inst/qtlocalpeer.cpp: In constructor ‘QtLocalPeer::QtLocalPeer(QObject, const QString&)’: single_inst/qtlocalpeer.cpp:96:54: error: ‘::getuid’ has not been declared single_inst/qtlocalpeer.cpp:96:54: note: suggested alternative: In file included from single_inst/qtlockedfile_unix.cpp:42:0, from single_inst/qtlocalpeer.cpp:60: /usr/include/unistd.h:698:16: note: ‘QtLP_Private::getuid’ make: [build/qtlocalpeer.o] Error 1 make: Waiting for unfinished jobs..


About the this problem I found brief comment: On unix we need unistd.h included in the qtlocalpeer.cpp, just below the time.h include in the #if defined (Q_OS_UNIX) include section. Thanks! Guardiano

proton commented 12 years ago

Interesting...

I can't compile code with your patch.

single_inst/qtlocalpeer.cpp: In constructor 'QtLocalPeer::QtLocalPeer(QObject*, const QString&)':
single_inst/qtlocalpeer.cpp:96:51: error: 'getuid' is not a member of 'QtLP_Private'
make: *** [build/qtlocalpeer.o] Error 1

getuid() is method from unistd.h (/usr/include/unistd.h on my pc). unistd.h is included in qtlockedfile_unix.cpp at line 42. So I don't know, how to reproduce your error.

alium commented 12 years ago

Another (much better) fix:

unistd.h must be defined in qtlocalpeer.cpp

So just add #include <unistd.h> to qtlocalpeer.cpp

After that (without patches) for me to compile it without problems