User forums > Announcements

Code::Blocks On macOS

(1/2) > >>

Code::BlocksOnmacOS:
Guess what guys? I just compiled Code::Block 16.01 on macOS Sierra! I am most willing to contribute to this project. Some things to note:
Makefile.in,Makefile.am,and aclocal.in are NOT NEEDED, otherwise it throws error about automakers not being found, although you don't need it anyway.
All I'm using to compile is:
HomeBrew with wxwidgets installed (plus a whole bunch of other, un-related things)
Xcode Command-Line Utils
Might try to post a working binary eventually. I'll keep things updated here.
Happy Coding ;)

Code::BlocksOnmacOS:
Here's an update - got 4 weird errors concerning the build:

--- Code: ---make[4]: *** [debuggergdb.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
--- End code ---
If you can explain to me what this is (if you can re-create the error) That will help LOADS

Code::BlocksOnmacOS:
I just hope a working macOS build WILL happen - no errors, 14 warnings, then 4 errors... Not even explaining WHY there are errors!

BlueHazzard:
don't have any mac so I can't help much, but there has to be more output...
Here at the forum are other user who have reported to build codeblocks fine. You can try to use their approach and build codeblocks through codeblocks afterward...

What does the console output before the error messages, what is the command line you invoke?

are there any .log files in the build directory?

oatssss:
I was able to reproduce those errors. However, instead of completely deleting Makefile.in, Makefile.am, and aclocal.m4, I just updated their time-stamps (as suggested here http://stackoverflow.com/a/33279062/1675668) using touch with the following command:


--- Code: ---touch aclocal.m4 configure Makefile.am Makefile.in
--- End code ---

Hunspell is a dependency so I just installed it using HomeBrew. For wxWidgets, I did not use the one through HomeBrew, but instead built it myself on 10.12 Sierra (wxWidgets-3.0.3).

Error #1 (use of overloaded operator '==' is ambiguous)
Trying to build using make reports 4 warnings, 1 error when attempting to compile $(CB_ROOT)/src/plugins/debuggergdb/debuggergdb.cpp. The specific error:


--- Code: ---In file included from debuggergdb.cpp:10:
In file included from ../../../src/include/sdk.h:17:
In file included from ../../../src/include/sdk_precomp.h:13:
In file included from ../../../src/include/sdk_common.h:43:
../../../src/include/prep.h:33:75: error: use of overloaded operator '==' is ambiguous (with operand types 'const std::__1::shared_ptr<GDBWatch>' and 'int')
        template<typename T> bool equals(T const& rhs) const { return rhs == 0; }
                                                                      ~~~ ^  ~
--- End code ---

This error has actually been encountered before on this forum:

--- Quote from: Easior Lars on June 10, 2015, 02:58:10 am ---
--- Code: ---../../../../src/include/prep.h:33:75: error: use of overloaded operator '==' is ambiguous (with operand types 'const std::__1::shared_ptr<GDBWatch>' and 'int')
        template<typename T> bool equals(T const& rhs) const { return rhs == 0; }
                                                                      ~~~ ^  ~

--- End code ---

--- End quote ---

The suggestion was to add CXXFLAGS="-stdlib=libc++". I had previously used this solution to build wxWidgets (since I did not use HomeBrew) and I instead used CXXFLAGS="-stdlib=libc++ -std=c++" LDFLAGS="-stdlib=libc++" so I used the latter for configuring the build of Code::Blocks. My configure command looked like:
--- Code: ---./configure --with-contrib-plugins=all CXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++"
--- End code ---

Error #2 ('fam.h' file not found)
Attempting to make again results in another error:

--- Code: ---In file included from directorymonitor.cpp:3:
In file included from ./se_globals.h:10:
In file included from ../../../../src/include/sdk.h:17:
In file included from ../../../../src/include/sdk_precomp.h:13:
In file included from ../../../../src/include/sdk_common.h:150:
In file included from ../../../../src/include/filemanager.h:13:
../../../../src/include/backgroundthread.h:143:13: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
        if (this && IsRunning())
            ^~~~ ~~
directorymonitor.cpp:27:10: fatal error: 'fam.h' file not found
#include <fam.h> //USES EITHER GAMIN OR FAM (IDENTICAL FILE MONITORING APIS)
         ^
3 warnings and 1 error generated.
--- End code ---

This issue had also been encountered previously and was solved by ommiting a couple plugins:

--- Quote from: federix on February 05, 2016, 06:04:04 pm ---Ok, so I managed to move forward in the compile process by leaving out a couple of plugins...

-FileManager,-NassiShneiderman

--- End quote ---

So the configure command turned into:
--- Code: ---./configure --with-contrib-plugins=all,-FileManager,-NassiShneiderman CXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++"
--- End code ---

Success! (Partially)
Running make one last time after the above configure ran without a hitch. The last step was to run make install to move the binary into /usr/local/bin.



Missing Plugins (and maybe other components)
Unfortunately, the plugins do not work. Running codeblocks in the shell to open up the IDE reveals that it gets stuck when initializing plugins; opening up the plugin manager reveals no plugins loaded.


So although the interface is up and running, some components are missing :( Maybe I missed something in the build configuration?

Navigation

[0] Message Index

[#] Next page

Go to full version