Problem With Sqliqte_Modern_CPP  [SOLVED]

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
ChronoGraff
Knows some wx things
Knows some wx things
Posts: 42
Joined: Wed Apr 22, 2015 5:42 pm

Problem With Sqliqte_Modern_CPP

Postby ChronoGraff » Fri Jan 26, 2018 2:43 pm

Hi guys, it's been a while but here I am back again with a problem I can't figure out. Please see the trace below:

Many thanks folks!

Code: Select all

make
[  4%] Building CXX object src/CMakeFiles/chrono.dir/main.cc.o
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: warning: /usr/local/Cellar/llvm/5.0.1/bin/clang++: 'linker' input unused
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -coverage-file /Users/darranthompson/Dev/C++/chronograff/build/src/CMakeFiles/chrono.dir/main.cc.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -isystem /usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -isystem /usr/local/include/wx-3.1 -D BUILD_CHRONO_TESTS -D CMAKE_USE_OPENSSL -D WXUSINGDLL -D _FILE_OFFSET_BITS=64 -D __WXMAC__ -D __WXOSX_COCOA__ -D __WXOSX__ -I /Users/darranthompson/Dev/C++/chronograff -I /Users/darranthompson/Dev/C++/chronograff/include -stdlib=libc++ -O2 -Wall -std=c++0x -fdeprecated-macro -fdebug-compilation-dir /Users/darranthompson/Dev/C++/chronograff/build/src -ferror-limit 19 -fmessage-length 160 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o CMakeFiles/chrono.dir/main.cc.o -x c++ /Users/darranthompson/Dev/C++/chronograff/src/main.cc
clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
 /Users/darranthompson/Dev/C++/chronograff
 /Users/darranthompson/Dev/C++/chronograff/include
 /usr/local/lib/wx/include/osx_cocoa-unicode-3.1
 /usr/local/include/wx-3.1
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
In file included from /Users/darranthompson/Dev/C++/chronograff/src/main.cc:10:
In file included from /Users/darranthompson/Dev/C++/chronograff/include/chronograff/main.h:29:
In file included from /Users/darranthompson/Dev/C++/chronograff/include/chronograff/setup.h:19:
/usr/local/include/sqlite_modern_cpp.h:58:38: error: no type named 'optional' in namespace 'std::experimental'
        using optional = std::experimental::optional<T>;
                         ~~~~~~~~~~~~~~~~~~~^
/usr/local/include/sqlite_modern_cpp.h:58:46: error: expected ';' after alias declaration
        using optional = std::experimental::optional<T>;
                                                    ^
/usr/local/include/sqlite_modern_cpp.h:253:96: error: unknown type name 'optional'
                template <typename OptionalT> friend database_binder& operator <<(database_binder& db, const optional<OptionalT>& val);
                                                                                                             ^
/usr/local/include/sqlite_modern_cpp.h:253:104: error: expected ')'
                template <typename OptionalT> friend database_binder& operator <<(database_binder& db, const optional<OptionalT>& val);
                                                                                                                     ^
/usr/local/include/sqlite_modern_cpp.h:253:68: note: to match this '('
                template <typename OptionalT> friend database_binder& operator <<(database_binder& db, const optional<OptionalT>& val);
                                                                                 ^
/usr/local/include/sqlite_modern_cpp.h:254:91: error: unknown type name 'optional'
                template <typename OptionalT> friend void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o);
                                                                                                        ^
/usr/local/include/sqlite_modern_cpp.h:254:99: error: expected ')'
                template <typename OptionalT> friend void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o);
                                                                                                                ^
/usr/local/include/sqlite_modern_cpp.h:254:60: note: to match this '('
                template <typename OptionalT> friend void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o);
                                                                         ^
/usr/local/include/sqlite_modern_cpp.h:801:95: error: unknown type name 'optional'
        template <typename OptionalT> inline database_binder& operator <<(database_binder& db, const optional<OptionalT>& val) {
                                                                                                     ^
/usr/local/include/sqlite_modern_cpp.h:801:103: error: expected ')'
        template <typename OptionalT> inline database_binder& operator <<(database_binder& db, const optional<OptionalT>& val) {
                                                                                                             ^
/usr/local/include/sqlite_modern_cpp.h:801:67: note: to match this '('
        template <typename OptionalT> inline database_binder& operator <<(database_binder& db, const optional<OptionalT>& val) {
                                                                         ^
/usr/local/include/sqlite_modern_cpp.h:802:6: error: use of undeclared identifier 'val'
                if(val) {
                   ^
/usr/local/include/sqlite_modern_cpp.h:803:28: error: use of undeclared identifier 'val'
                        return db << std::move(*val);
                                                ^
/usr/local/include/sqlite_modern_cpp.h:808:90: error: unknown type name 'optional'
        template <typename OptionalT> inline void store_result_in_db(sqlite3_context* db, const optional<OptionalT>& val) {
                                                                                                ^
/usr/local/include/sqlite_modern_cpp.h:808:98: error: expected ')'
        template <typename OptionalT> inline void store_result_in_db(sqlite3_context* db, const optional<OptionalT>& val) {
                                                                                                        ^
/usr/local/include/sqlite_modern_cpp.h:808:62: note: to match this '('
        template <typename OptionalT> inline void store_result_in_db(sqlite3_context* db, const optional<OptionalT>& val) {
                                                                    ^
/usr/local/include/sqlite_modern_cpp.h:809:6: error: use of undeclared identifier 'val'
                if(val) {
                   ^
/usr/local/include/sqlite_modern_cpp.h:810:28: error: use of undeclared identifier 'val'
                        store_result_in_db(db, *val);
                                                ^
/usr/local/include/sqlite_modern_cpp.h:815:90: error: unknown type name 'optional'
        template <typename OptionalT> inline void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o) {
                                                                                                ^
/usr/local/include/sqlite_modern_cpp.h:815:98: error: expected ')'
        template <typename OptionalT> inline void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o) {
                                                                                                        ^
/usr/local/include/sqlite_modern_cpp.h:815:59: note: to match this '('
        template <typename OptionalT> inline void get_col_from_db(database_binder& db, int inx, optional<OptionalT>& o) {
                                                                 ^
/usr/local/include/sqlite_modern_cpp.h:818:4: error: use of undeclared identifier 'o'
                        o = std::experimental::nullopt;
                        ^
/usr/local/include/sqlite_modern_cpp.h:818:27: error: no member named 'nullopt' in namespace 'std::experimental'
                        o = std::experimental::nullopt;
                            ~~~~~~~~~~~~~~~~~~~^
/usr/local/include/sqlite_modern_cpp.h:825:4: error: use of undeclared identifier 'o'
                        o = std::move(v);
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/CMakeFiles/chrono.dir/main.cc.o] Error 1
make[1]: *** [src/CMakeFiles/chrono.dir/all] Error 2
make: *** [all] Error 2
➜  build git:(master) ✗


And here is my compiler.cmake

Code: Select all

if(NOT ${CMAKE_VERSION} LESS 3.2)
    set(CMAKE_CXX_STANDARD 11)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
else()
    message(STATUS "Checking compiler flags for C++11 support.")
    # Set C++11 support flags for various compilers
    include(CheckCXXCompilerFlag)

    check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
    check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)

    set(CMAKE_CXX_FLAGS)

    if(COMPILER_SUPPORTS_CXX11)
        message(STATUS "C++11 is supported.")
        if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -O2 -Wall -g -v -c")
        else()
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -O2 -Wall -g -v -c")
        endif()
    elseif(COMPILER_SUPPORTS_CXX0X)
        message(STATUS "C++0x is supported.")
        if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++")
        else()
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
        endif()
    else()
        message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
    endif()
endif()

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: Problem With Sqliqte_Modern_CPP

Postby eranon » Fri Jan 26, 2018 3:32 pm

Hello, Not sure I would relay on std::experimental (unreliable and subject to change by definition) for a production release, but what if you add something like "#include <experimental/optional>" in the relevant file?
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

ChronoGraff
Knows some wx things
Knows some wx things
Posts: 42
Joined: Wed Apr 22, 2015 5:42 pm

Re: Problem With Sqliqte_Modern_CPP  [SOLVED]

Postby ChronoGraff » Fri Jan 26, 2018 3:40 pm

Thanks for the reply, I sorted the compile error by reverting to version 2.4 (sqlite modern cpp).


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 6 guests