/usr/include/qt4/QtCore/qstring.h:1003: instantiated from here/usr/include/c++/4.3/bits/stl_iterator.h:676: error: no type named 'difference_type' in 'struct std::iterator_traits<wchar_t*>'/usr/include/c++/4.3/bits/stl_iterator.h:727: error: no type named 'difference_type' in 'struct std::iterator_traits<wchar_t*>'/usr/include/c++/4.3/bits/stl_iterator.h:731: error: no type named 'difference_type' in 'struct std::iterator_traits<wchar_t*>'/usr/include/c++/4.3/bits/stl_iterator.h:735: error: no type named 'difference_type' in 'struct std::iterator_traits<wchar_t*>'/usr/include/c++/4.3/bits/stl_iterator.h:739: error: no type named 'difference_type' in 'struct std::iterator_traits<wchar_t*>'/usr/include/c++/4.3/bits/stl_iterator.h:743: error: no type named 'difference_type' in 'struct std::iterator_traits<wchar_t*>'In file included from /usr/include/qt4/QtCore/qdebug.h:42, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/qt4/QtCore/qhash.h:313: error: 'ptrdiff_t' does not name a type/usr/include/qt4/QtCore/qhash.h:378: error: 'ptrdiff_t' does not name a type/usr/include/qt4/QtCore/qhash.h:462: error: 'ptrdiff_t' does not name a typeIn file included from /usr/include/c++/4.3/map:65, from /usr/include/qt4/QtCore/qmap.h:46, from /usr/include/qt4/QtCore/qdebug.h:44, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/c++/4.3/bits/stl_tree.h:158: error: 'ptrdiff_t' does not name a type/usr/include/c++/4.3/bits/stl_tree.h:230: error: 'ptrdiff_t' does not name a type/usr/include/c++/4.3/bits/stl_tree.h:339: error: 'ptrdiff_t' does not name a typeIn file included from /usr/include/qt4/QtCore/qdebug.h:44, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/qt4/QtCore/qmap.h:196: error: 'ptrdiff_t' does not name a type/usr/include/qt4/QtCore/qmap.h:264: error: 'ptrdiff_t' does not name a type/usr/include/qt4/QtCore/qmap.h:367: error: 'ptrdiff_t' does not name a typeIn file included from /usr/include/c++/4.3/vector:70, from /usr/include/qt4/QtCore/qvector.h:48, from /usr/include/qt4/QtCore/qdebug.h:48, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/c++/4.3/bits/stl_vector.h:198: error: 'ptrdiff_t' does not name a typeIn file included from /usr/include/c++/4.3/vector:71, from /usr/include/qt4/QtCore/qvector.h:48, from /usr/include/qt4/QtCore/qdebug.h:48, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/c++/4.3/bits/stl_bvector.h:111: error: template argument 3 is invalid/usr/include/c++/4.3/bits/stl_bvector.h:140: error: 'ptrdiff_t' has not been declared/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'void std::_Bit_iterator_base::_M_incr(int)':/usr/include/c++/4.3/bits/stl_bvector.h:142: error: 'difference_type' was not declared in this scope/usr/include/c++/4.3/bits/stl_bvector.h:142: error: expected `;' before '__n'/usr/include/c++/4.3/bits/stl_bvector.h:143: error: '__n' was not declared in this scope/usr/include/c++/4.3/bits/stl_bvector.h: At global scope:/usr/include/c++/4.3/bits/stl_bvector.h:182: error: expected initializer before 'operator'/usr/include/c++/4.3/bits/stl_bvector.h:234: error: declaration of 'operator+=' as non-function/usr/include/c++/4.3/bits/stl_bvector.h:234: error: expected ';' before '(' token/usr/include/c++/4.3/bits/stl_bvector.h:240: error: expected `;' before 'iterator'/usr/include/c++/4.3/bits/stl_bvector.h:241: error: declaration of 'operator-=' as non-function/usr/include/c++/4.3/bits/stl_bvector.h:241: error: expected ';' before '(' token/usr/include/c++/4.3/bits/stl_bvector.h:247: error: expected `;' before 'iterator'/usr/include/c++/4.3/bits/stl_bvector.h:248: error: 'difference_type' has not been declared/usr/include/c++/4.3/bits/stl_bvector.h:255: error: 'difference_type' has not been declared/usr/include/c++/4.3/bits/stl_bvector.h:262: error: 'difference_type' has not been declared/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'std::_Bit_iterator std::_Bit_iterator::operator+(int) const':/usr/include/c++/4.3/bits/stl_bvector.h:251: error: no match for 'operator+=' in '__tmp += __i'/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'std::_Bit_iterator std::_Bit_iterator::operator-(int) const':/usr/include/c++/4.3/bits/stl_bvector.h:258: error: no match for 'operator-=' in '__tmp -= __i'/usr/include/c++/4.3/bits/stl_bvector.h: At global scope:/usr/include/c++/4.3/bits/stl_bvector.h:267: error: declaration of 'operator+' as non-function/usr/include/c++/4.3/bits/stl_bvector.h:267: error: 'ptrdiff_t' was not declared in this scope/usr/include/c++/4.3/bits/stl_bvector.h:267: error: expected primary-expression before 'const'/usr/include/c++/4.3/bits/stl_bvector.h:320: error: declaration of 'operator+=' as non-function/usr/include/c++/4.3/bits/stl_bvector.h:320: error: expected ';' before '(' token/usr/include/c++/4.3/bits/stl_bvector.h:326: error: expected `;' before 'const_iterator'/usr/include/c++/4.3/bits/stl_bvector.h:327: error: declaration of 'operator-=' as non-function/usr/include/c++/4.3/bits/stl_bvector.h:327: error: expected ';' before '(' token/usr/include/c++/4.3/bits/stl_bvector.h:333: error: expected `;' before 'const_iterator'/usr/include/c++/4.3/bits/stl_bvector.h:334: error: 'difference_type' has not been declared/usr/include/c++/4.3/bits/stl_bvector.h:341: error: 'difference_type' has not been declared/usr/include/c++/4.3/bits/stl_bvector.h:348: error: 'difference_type' has not been declared/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'std::_Bit_const_iterator std::_Bit_const_iterator::operator+(int) const':/usr/include/c++/4.3/bits/stl_bvector.h:337: error: no match for 'operator+=' in '__tmp += __i'/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'std::_Bit_const_iterator std::_Bit_const_iterator::operator-(int) const':/usr/include/c++/4.3/bits/stl_bvector.h:344: error: no match for 'operator-=' in '__tmp -= __i'/usr/include/c++/4.3/bits/stl_bvector.h: At global scope:/usr/include/c++/4.3/bits/stl_bvector.h:353: error: declaration of 'operator+' as non-function/usr/include/c++/4.3/bits/stl_bvector.h:353: error: 'ptrdiff_t' was not declared in this scope/usr/include/c++/4.3/bits/stl_bvector.h:353: error: expected primary-expression before 'const'/usr/include/c++/4.3/bits/stl_bvector.h:485: error: 'ptrdiff_t' does not name a type/usr/include/c++/4.3/bits/stl_iterator_base_types.h: In instantiation of 'std::iterator_traits<std::_Bit_iterator>':/usr/include/c++/4.3/bits/stl_iterator.h:108: instantiated from 'std::reverse_iterator<std::_Bit_iterator>'/usr/include/c++/4.3/bits/stl_bvector.h:605: instantiated from here/usr/include/c++/4.3/bits/stl_iterator_base_types.h:133: error: no type named 'iterator_category' in 'struct std::_Bit_iterator'/usr/include/c++/4.3/bits/stl_iterator_base_types.h:134: error: no type named 'value_type' in 'struct std::_Bit_iterator'/usr/include/c++/4.3/bits/stl_iterator_base_types.h:135: error: no type named 'difference_type' in 'struct std::_Bit_iterator'/usr/include/c++/4.3/bits/stl_iterator_base_types.h: In instantiation of 'std::iterator_traits<std::_Bit_const_iterator>':/usr/include/c++/4.3/bits/stl_iterator.h:108: instantiated from 'std::reverse_iterator<std::_Bit_const_iterator>'/usr/include/c++/4.3/bits/stl_bvector.h:609: instantiated from here/usr/include/c++/4.3/bits/stl_iterator_base_types.h:133: error: no type named 'iterator_category' in 'struct std::_Bit_const_iterator'/usr/include/c++/4.3/bits/stl_iterator_base_types.h:134: error: no type named 'value_type' in 'struct std::_Bit_const_iterator'/usr/include/c++/4.3/bits/stl_iterator_base_types.h:135: error: no type named 'difference_type' in 'struct std::_Bit_const_iterator'/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'size_t std::vector<bool, _Alloc>::max_size() const':/usr/include/c++/4.3/bits/stl_bvector.h:645: error: 'difference_type' was not declared in this scope/usr/include/c++/4.3/bits/stl_bvector.h:645: error: template argument 1 is invalid/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'std::_Bit_iterator std::vector<bool, _Alloc>::insert(std::_Bit_iterator, const bool&)':/usr/include/c++/4.3/bits/stl_bvector.h:758: error: 'difference_type' does not name a type/usr/include/c++/4.3/bits/stl_bvector.h:764: error: '__n' was not declared in this scope/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'void std::vector<bool, _Alloc>::resize(size_t, bool)':/usr/include/c++/4.3/bits/stl_bvector.h:804: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available/usr/include/c++/4.3/bits/stl_bvector.h: In member function 'void std::vector<bool, _Alloc>::_M_initialize(size_t)':/usr/include/c++/4.3/bits/stl_bvector.h:841: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be availableIn file included from /usr/include/c++/4.3/vector:74, from /usr/include/qt4/QtCore/qvector.h:48, from /usr/include/qt4/QtCore/qdebug.h:48, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/c++/4.3/bits/vector.tcc: In member function 'void std::vector<bool, _Alloc>::_M_fill_insert(std::_Bit_iterator, size_t, bool)':/usr/include/c++/4.3/bits/vector.tcc:566: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available/usr/include/c++/4.3/bits/vector.tcc:567: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available/usr/include/c++/4.3/bits/vector.tcc:568: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available/usr/include/c++/4.3/bits/vector.tcc:577: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available/usr/include/c++/4.3/bits/vector.tcc:579: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available/usr/include/c++/4.3/bits/vector.tcc: In member function 'void std::vector<bool, _Alloc>::_M_insert_range(std::_Bit_iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':/usr/include/c++/4.3/bits/vector.tcc:602: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available/usr/include/c++/4.3/bits/vector.tcc:604: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be availableIn file included from /usr/include/qt4/QtCore/qdebug.h:48, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/qt4/QtCore/qvector.h: At global scope:/usr/include/qt4/QtCore/qvector.h:249: error: 'ptrdiff_t' does not name a typeIn file included from /usr/include/qt4/QtCore/qdebug.h:49, from /usr/include/qt4/QtCore/QDebug:1, from main.cpp:2:/usr/include/qt4/QtCore/qset.h:94: error: 'ptrdiff_t' does not name a type/usr/include/qt4/QtCore/qset.h:129: error: 'ptrdiff_t' does not name a type/usr/include/qt4/QtCore/qset.h:185: error: 'ptrdiff_t' does not name a typeIn file included from thread.h:10, from main.cpp:6:functions.h:1: error: 'ifndef' does not name a typemain.cpp: In function 'int main(int, char**)':main.cpp:10: error: 'QCoreApplication' was not declared in this scopemain.cpp:10: error: expected `;' before 'a'make: *** [main.o] Error 1
C++ (Qt)#include <QtCore/QCoreApplication>#include <iostream> int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); std::string strIn; std::cin >> strIn; std::cout << strIn << std::endl; return 0; //return a.exec();}
C++ (Qt)QT += core network QT -= gui TARGET = gpcCONFIG += consoleCONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp \ thread.cpp \ functions.cpp HEADERS += thread.h \ functions.h //INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlibзаменил наINCLUDEPATH += /usr/include
C++ (Qt)#include <QtCore/QCoreApplication>#include <QDebug>#include <iostream>#include <QTextCodec> #include "thread.h" int main(int argc, char *argv[]) //{ QCoreApplication a(argc, argv); QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForLocale(codec); //QTextCodec::setCodecForTr(codec); QTextStream out(stdout); QTextStream in(stdin);if (argc == 2) { QString command = argv[1]; if (command == "start") { //qDebug() << "do thread"; googlePositionCheckerThread thread; thread.start(); thread.wait(); //qDebug() << "posle thread"; return 0; } else if (command == "stop") { // как-то остановить, но не выйти! // вернуть управление в консоль } else if (command == "exit" || command == "quit") { return 0; } } else { // ничего не делать, программа не должна завершиться //return 0; не? } return 0;}
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I/usr/include -I. -I. -o main.o main.cppIn file included from main.cpp:6:thread.h:8:25: error: QElapsedTimer: No such file or directoryIn file included from thread.h:10, from main.cpp:6:functions.h:1: error: stray '\357' in programfunctions.h:1: error: stray '\273' in programfunctions.h:1: error: stray '\277' in programfunctions.h:1: error: stray '#' in programIn file included from thread.h:10, from main.cpp:6:functions.h:70:2: error: #endif without #iffunctions.h:1: error: 'ifndef' does not name a typemake: *** [main.o] Error 1