davidmoreno / onion

C library to create simple HTTP servers and Web Applications.
http://www.coralbits.com/libonion/
Other
2.02k stars 252 forks source link

Arm cross compilation c++ compilation failed #257

Open pioneerAlone opened 5 years ago

pioneerAlone commented 5 years ago

Hi At the ti arm tool chain arm-arago-linux-gnueabi-gcc/g++ try to compile error

[ 25%] Building C object src/onion/CMakeFiles/onion.dir/handlers/opack.c.o [ 26%] Building C object src/onion/CMakeFiles/onion.dir/handlers/path.c.o [ 26%] Building C object src/onion/CMakeFiles/onion.dir/handlers/internal_status.c.o [ 27%] Building C object src/onion/CMakeFiles/onion.dir/version.c.o [ 27%] Building C object src/onion/CMakeFiles/onion.dir/poller.c.o [ 28%] Building C object src/onion/CMakeFiles/onion.dir/random-default.c.o [ 28%] Linking C shared library libonion.so [ 28%] Built target onion [ 28%] Building CXX object src/bindings/cpp/CMakeFiles/onioncpp_static.dir/dict.cpp.o In file included from /home/work/onion/src/bindings/cpp/dict.cpp:23:0: /home/work/onion/src/bindings/cpp/dict.hpp:48:11: error: expected nested-name-specifier before 'internal_pointer' /home/work/onion/src/bindings/cpp/dict.hpp:48:11: error: using-declaration for non-member at class scope /home/work/onion/src/bindings/cpp/dict.hpp:48:28: error: expected ';' before '=' token /home/work/onion/src/bindings/cpp/dict.hpp:48:28: error: expected unqualified-id before '=' token /home/work/onion/src/bindings/cpp/dict.hpp:50:5: error: 'internal_pointer' does not name a type /home/work/onion/src/bindings/cpp/dict.hpp:59:33: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:60:32: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:56:48: error: looser throw specifier for 'virtual Onion::Dict::key_not_found::~key_not_found()' /opt/arm-arago-linux-gnueabi/bin/../lib/gcc/arm-arago-linux-gnueabi/4.5.3/../../../../arm-arago-linux-gnueabi/include/c++/4.5.3/exception:65:13: error: overriding 'virtual std::exception::~exception() throw ()' /home/work/onion/src/bindings/cpp/dict.hpp:159:43: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:166:47: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:175:31: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:185:9: error: expected ';' before 'Dict' /home/work/onion/src/bindings/cpp/dict.hpp:186:47: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:192:28: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:197:42: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:202:26: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:207:7: error: expected ';' before 'std' /home/work/onion/src/bindings/cpp/dict.hpp:207:34: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:214:56: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:221:46: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:244:27: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.cpp:157:2: error: expected ';' at end of input /home/work/onion/src/bindings/cpp/dict.cpp:157:2: error: expected '}' at end of input In file included from /home/work/onion/src/bindings/cpp/dict.cpp:23:0: /home/work/onion/src/bindings/cpp/dict.hpp: In constructor 'Onion::Dict::lock::lock(Onion::Dict::lock&&)': /home/work/onion/src/bindings/cpp/dict.hpp:75:18: error: 'nullptr' was not declared in this scope /home/work/onion/src/bindings/cpp/dict.hpp: In constructor 'Onion::Dict::Dict()': /home/work/onion/src/bindings/cpp/dict.hpp:104:9: error: class 'Onion::Dict' does not have any field named 'ptr' /home/work/onion/src/bindings/cpp/dict.hpp: In member function 'std::string Onion::Dict::operator[](const std::string&) const': /home/work/onion/src/bindings/cpp/dict.hpp:132:38: error: 'ptr' was not declared in this scope /home/work/onion/src/bindings/cpp/dict.hpp: At global scope: /home/work/onion/src/bindings/cpp/dict.hpp:137:5: error: expected unqualified-id at end of input /home/work/onion/src/bindings/cpp/dict.hpp:137:5: error: expected '}' at end of input src/bindings/cpp/CMakeFiles/onioncpp_static.dir/build.make:62: recipe for target 'src/bindings/cpp/CMakeFiles/onioncpp_static.dir/dict.cpp.o' failed make[2]: [src/bindings/cpp/CMakeFiles/onioncpp_static.dir/dict.cpp.o] Error 1 CMakeFiles/Makefile2:277: recipe for target 'src/bindings/cpp/CMakeFiles/onioncpp_static.dir/all' failed make[1]: [src/bindings/cpp/CMakeFiles/onioncpp_static.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2

davidmoreno commented 5 years ago

If you are not going to use C++, just compile the src/onion/ directory, and install only that (do make when at build/src/onion/). If you are going to use C++, you can use jus teh C library, or try to fix the library. Quite probably the errors are because your compiler does not support C++11 (or C++14, I dont remember which one was I aiming for).

Let us know what works for you.

Regards, David.

On Mon, 23 Sep 2019 at 08:43, pioneerAlone notifications@github.com wrote:

Hi At the ti arm tool chain arm-arago-linux-gnueabi-gcc/g++ try to compile error

[ 25%] Building C object src/onion/CMakeFiles/onion.dir/handlers/opack.c.o [ 26%] Building C object src/onion/CMakeFiles/onion.dir/handlers/path.c.o [ 26%] Building C object src/onion/CMakeFiles/onion.dir/handlers/internal_status.c.o [ 27%] Building C object src/onion/CMakeFiles/onion.dir/version.c.o [ 27%] Building C object src/onion/CMakeFiles/onion.dir/poller.c.o [ 28%] Building C object src/onion/CMakeFiles/onion.dir/random-default.c.o [ 28%] Linking C shared library libonion.so [ 28%] Built target onion [ 28%] Building CXX object src/bindings/cpp/CMakeFiles/onioncpp_static.dir/dict.cpp.o In file included from /home/work/onion/src/bindings/cpp/dict.cpp:23:0: /home/work/onion/src/bindings/cpp/dict.hpp:48:11: error: expected nested-name-specifier before 'internal_pointer' /home/work/onion/src/bindings/cpp/dict.hpp:48:11: error: using-declaration for non-member at class scope /home/work/onion/src/bindings/cpp/dict.hpp:48:28: error: expected ';' before '=' token /home/work/onion/src/bindings/cpp/dict.hpp:48:28: error: expected unqualified-id before '=' token /home/work/onion/src/bindings/cpp/dict.hpp:50:5: error: 'internal_pointer' does not name a type /home/work/onion/src/bindings/cpp/dict.hpp:59:33: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:60:32: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:56:48: error: looser throw specifier for 'virtual Onion::Dict::key_not_found::~key_not_found()' /opt/arm-arago-linux-gnueabi/bin/../lib/gcc/arm-arago-linux-gnueabi/4.5.3/../../../../arm-arago-linux-gnueabi/include/c++/4.5.3/exception:65:13: error: overriding 'virtual std::exception::~exception() throw ()' /home/work/onion/src/bindings/cpp/dict.hpp:159:43: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:166:47: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:175:31: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:185:9: error: expected ';' before 'Dict' /home/work/onion/src/bindings/cpp/dict.hpp:186:47: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:192:28: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:197:42: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:202:26: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:207:7: error: expected ';' before 'std' /home/work/onion/src/bindings/cpp/dict.hpp:207:34: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:214:56: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:221:46: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.hpp:244:27: error: expected ';' before 'noexcept' /home/work/onion/src/bindings/cpp/dict.cpp:157:2: error: expected ';' at end of input /home/work/onion/src/bindings/cpp/dict.cpp:157:2: error: expected '}' at end of input In file included from /home/work/onion/src/bindings/cpp/dict.cpp:23:0: /home/work/onion/src/bindings/cpp/dict.hpp: In constructor 'Onion::Dict:🔒 :lock(Onion::Dict::lock&&)': /home/work/onion/src/bindings/cpp/dict.hpp:75:18: error: 'nullptr' was not declared in this scope /home/work/onion/src/bindings/cpp/dict.hpp: In constructor 'Onion::Dict::Dict()': /home/work/onion/src/bindings/cpp/dict.hpp:104:9: error: class 'Onion::Dict' does not have any field named 'ptr' /home/work/onion/src/bindings/cpp/dict.hpp: In member function 'std::string Onion::Dict::operator[](const std::string&) const': /home/work/onion/src/bindings/cpp/dict.hpp:132:38: error: 'ptr' was not declared in this scope /home/work/onion/src/bindings/cpp/dict.hpp: At global scope: /home/work/onion/src/bindings/cpp/dict.hpp:137:5: error: expected unqualified-id at end of input /home/work/onion/src/bindings/cpp/dict.hpp:137:5: error: expected '}' at end of input src/bindings/cpp/CMakeFiles/onioncpp_static.dir/build.make:62: recipe for target 'src/bindings/cpp/CMakeFiles/onioncpp_static.dir/dict.cpp.o' failed make[2]: [src/bindings/cpp/CMakeFiles/onioncpp_static.dir/dict.cpp.o] Error 1 CMakeFiles/Makefile2:277: recipe for target 'src/bindings/cpp/CMakeFiles/onioncpp_static.dir/all' failed make[1]: [src/bindings/cpp/CMakeFiles/onioncpp_static.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/davidmoreno/onion/issues/257?email_source=notifications&email_token=AACOZOUBZI3UXS2MPRUGNXLQLBQQXA5CNFSM4IZG6F7KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HM6M3RA, or mute the thread https://github.com/notifications/unsubscribe-auth/AACOZOSI3UWKOW5SCT6BDS3QLBQQXANCNFSM4IZG6F7A .

-- David Moreno Montero

dmoreno@coralbits.com +34 658 18 77 17 [image: Coralbits.com] http://www.coralbits.com/ http://www.coralbits.com

pioneerAlone commented 5 years ago

Hi,David Yes, only compile the c file to complete the compilation process; whether you can add the compile option (-std=c++11/14), complete the compilation of cpp, if so, where to set it.

zacharygrafton commented 4 years ago

What version of gcc are you using? You may be able to pass the -std=c++14 option through the CFLAGS environment variable to cmake, but it's a moot point if you c++ compiler doesn't support enough of C++11.