madeso / ride

Ride IDE
MIT License
172 stars 16 forks source link

Compile error on Mac OS X #87

Closed btbytes closed 8 years ago

btbytes commented 8 years ago

All the dependencies were installed.

brew install protobuf
brew install doxygen
brew install wxwidgets
brew install cppcheck
brew install clang-format

Build :

mkdir build
cd build
cmake .. 
make 

The error message:

                                              ^
/Users/foobar/src/ride/ride/language.cc:351:40: error: use of undeclared identifier 'wxSTC_LEX_RUST'
  RustLanguage() : Language(_("Rust"), wxSTC_LEX_RUST) {
                                       ^
/Users/foobar/src/ride/ride/language.cc:410:20: error: use of undeclared identifier 'wxSTC_RUST_DEFAULT'
    SetStyle(text, wxSTC_RUST_DEFAULT,
                   ^
/Users/foobar/src/ride/ride/language.cc:412:20: error: use of undeclared identifier 'wxSTC_RUST_COMMENTBLOCK'
    SetStyle(text, wxSTC_RUST_COMMENTBLOCK,
                   ^
/Users/foobar/src/ride/ride/language.cc:414:20: error: use of undeclared identifier 'wxSTC_RUST_COMMENTLINE'
    SetStyle(text, wxSTC_RUST_COMMENTLINE,
                   ^
/Users/foobar/src/ride/ride/language.cc:416:20: error: use of undeclared identifier 'wxSTC_RUST_COMMENTBLOCKDOC'
    SetStyle(text, wxSTC_RUST_COMMENTBLOCKDOC,
                   ^
/Users/foobar/src/ride/ride/language.cc:418:20: error: use of undeclared identifier 'wxSTC_RUST_COMMENTLINEDOC'
    SetStyle(text, wxSTC_RUST_COMMENTLINEDOC,
                   ^
/Users/foobar/src/ride/ride/language.cc:420:20: error: use of undeclared identifier 'wxSTC_RUST_NUMBER'
    SetStyle(text, wxSTC_RUST_NUMBER,
                   ^
/Users/foobar/src/ride/ride/language.cc:422:20: error: use of undeclared identifier 'wxSTC_RUST_WORD'
    SetStyle(text, wxSTC_RUST_WORD,
                   ^
/Users/foobar/src/ride/ride/language.cc:432:20: error: use of undeclared identifier 'wxSTC_RUST_CHARACTER'
    SetStyle(text, wxSTC_RUST_CHARACTER,
                   ^
/Users/foobar/src/ride/ride/language.cc:434:20: error: use of undeclared identifier 'wxSTC_RUST_STRING'
    SetStyle(text, wxSTC_RUST_STRING,
                   ^
/Users/foobar/src/ride/ride/language.cc:436:20: error: use of undeclared identifier 'wxSTC_RUST_STRINGR'
    SetStyle(text, wxSTC_RUST_STRINGR,
                   ^
/Users/foobar/src/ride/ride/language.cc:439:20: error: use of undeclared identifier 'wxSTC_RUST_OPERATOR'
    SetStyle(text, wxSTC_RUST_OPERATOR,
                   ^
/Users/foobar/src/ride/ride/language.cc:441:20: error: use of undeclared identifier 'wxSTC_RUST_IDENTIFIER'
    SetStyle(text, wxSTC_RUST_IDENTIFIER,
                   ^
/Users/foobar/src/ride/ride/language.cc:443:20: error: use of undeclared identifier 'wxSTC_RUST_LIFETIME'
    SetStyle(text, wxSTC_RUST_LIFETIME,
                   ^
/Users/foobar/src/ride/ride/language.cc:445:20: error: use of undeclared identifier 'wxSTC_RUST_MACRO'
    SetStyle(text, wxSTC_RUST_MACRO,
                   ^
/Users/foobar/src/ride/ride/language.cc:447:20: error: use of undeclared identifier 'wxSTC_RUST_LEXERROR'
    SetStyle(text, wxSTC_RUST_LEXERROR,
                   ^
10 warnings and 16 errors generated.
make[2]: *** [ride/CMakeFiles/ride.dir/language.cc.o] Error 1
make[1]: *** [ride/CMakeFiles/ride.dir/all] Error 2
make: *** [all] Error 2
btbytes commented 8 years ago

I just the comment about USE_CPP_AS_RUST. Let me try that and report back.

madeso commented 8 years ago

There is also a cmake var that force it to use the "legacy find" since I had to extend wxScintilla. On OsX one also has to take care to make sure the wx-config --with-macosx-version is the same as cmake_osx_deployment_target or there will be compile/link errors or segfaults ( I should write a build-osx.md file about this). Not sure how brew handles that though.

madeso commented 8 years ago

Now that I think about it, there probably are some optional cmake build commands that are enabled by default that "fixes" and lints the code that are enabled by default that you might want to also disable.

btbytes commented 8 years ago

I made the following change

diff --git a/ride/CMakeLists.txt b/ride/CMakeLists.txt
index 5d8683a..06c95c3 100644
--- a/ride/CMakeLists.txt
+++ b/ride/CMakeLists.txt
@@ -24,7 +24,8 @@ PROTOBUF_GENERATE_CPP(SETTINGS_PROTO_SRCS SETTINGS_PROTO_HDRS settings.proto)

 option(USE_WXWIDGETS_LEGACY_FINDTEXT "use the old wxwidgets findtext" OFF)
-option(USE_CPP_AS_RUST "fallback to use c++ lexer instead of the rust lexer" OFF)
+option(USE_CPP_AS_RUST "fallback to use c++ lexer instead of the rust lexer" ON)
+option(WX_WIDGETS_LEGACY_FINDTEXT "WX_WIDGETS_LEGACY_FINDTEXT" ON)

and compiled to get:

/Users/foobar/src/ride/ride/wxutils.cc:172:53: error: too many arguments to function call, expected at most 4, have 5
  return stc->FindText(minPos, maxPos, text, flags, findEnd);
         ~~~~~~~~~~~~~                              ^~~~~~~
/usr/local/Cellar/wxmac/3.0.2/include/wx-3.0/wx/stc/stc.h:3132:5: note: 'FindText' declared here
    int FindText(int minPos, int maxPos, const wxString& text, int flags=0);
    ^
10 warnings and 1 error generated.
madeso commented 8 years ago

as mentioned there is also WX_WIDGETS_LEGACY_FINDTEXT :)

madeso commented 8 years ago

Travis is using this cmake commandline: cmake -DBUILD_USE_CLANG_FORMAT=OFF -DBUILD_USE_CPPLINT=OFF -DBUILD_USE_DOXYGEN=OFF -DBUILD_USE_DOXYGEN_GLOBAL=OFF -DBUILD_USE_CPPCHECK=OFF -DBUILD_USE_INCLUDECHECK=OFF -DUSE_WXWIDGETS_LEGACY_FINDTEXT=ON -DUSE_CPP_AS_RUST=ON ..

btbytes commented 8 years ago

I had to chmod +x on all the python files first and

diff --git a/ride/CMakeLists.txt b/ride/CMakeLists.txt
index 5d8683a..768171c 100644
--- a/ride/CMakeLists.txt
+++ b/ride/CMakeLists.txt
@@ -23,8 +23,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 PROTOBUF_GENERATE_CPP(SETTINGS_PROTO_SRCS SETTINGS_PROTO_HDRS settings.proto)

-option(USE_WXWIDGETS_LEGACY_FINDTEXT "use the old wxwidgets findtext" OFF)
-option(USE_CPP_AS_RUST "fallback to use c++ lexer instead of the rust lexer" OFF)
+option(USE_WXWIDGETS_LEGACY_FINDTEXT "use the old wxwidgets findtext" ON)
+option(USE_CPP_AS_RUST "fallback to use c++ lexer instead of the rust lexer" ON)

and I was able to successfully build the application. However

It crashed with:

 build git:(master) ✗ ./ride/ride 
2015-09-23 14:40:27.190 ride[97334:4335293] Communications error: <OS_xpc_error: <error: 0x7fff733b1c60> { count = 1, contents =
        "XPCErrorDescription" => <string: 0x7fff733b1f70> { length = 18, contents = "Connection invalid" }
}>
madeso commented 8 years ago

Oh noes, never seen that, then again I haven't used brew. All the osx build problems I've had comes from me using the wrong osx dependcy target but this doesn't look like such a error. It might be how the dependency problem is shown with brew though. I use AppleClang, xcode and build all my dependencies myself just to be on the safe side.

btbytes commented 8 years ago

Anyhow... that appears to be a different bug, for a different time.. so, i'm going to close this ticket. Thanks for your help!