Author Topic: Code::Blocks On macOS  (Read 25769 times)

Offline Code::BlocksOnmacOS

  • Single posting newcomer
  • *
  • Posts: 3
    • Majick Tek
Code::Blocks On macOS
« on: January 17, 2017, 10:16:41 pm »
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 ;)
Everyone should learn how to program, because it teaches you how to think! - Steve Jobs
Creator of Majick Tek - GitHub.com/MajickTek

Offline Code::BlocksOnmacOS

  • Single posting newcomer
  • *
  • Posts: 3
    • Majick Tek
Re: Code::Blocks On macOS
« Reply #1 on: January 17, 2017, 10:23:03 pm »
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
If you can explain to me what this is (if you can re-create the error) That will help LOADS
Everyone should learn how to program, because it teaches you how to think! - Steve Jobs
Creator of Majick Tek - GitHub.com/MajickTek

Offline Code::BlocksOnmacOS

  • Single posting newcomer
  • *
  • Posts: 3
    • Majick Tek
Re: Code::Blocks On macOS
« Reply #2 on: January 17, 2017, 10:25:39 pm »
I just hope a working macOS build WILL happen - no errors, 14 warnings, then 4 errors... Not even explaining WHY there are errors!
Everyone should learn how to program, because it teaches you how to think! - Steve Jobs
Creator of Majick Tek - GitHub.com/MajickTek

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Code::Blocks On macOS
« Reply #3 on: January 18, 2017, 12:04:58 pm »
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

  • Guest
Re: Code::Blocks On macOS
« Reply #4 on: May 12, 2017, 07:44:08 am »
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

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; }
                                                                      ~~~ ^  ~

This error has actually been encountered before on this forum:
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; }
                                                                      ~~~ ^  ~

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++"

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.

This issue had also been encountered previously and was solved by ommiting a couple plugins:
Ok, so I managed to move forward in the compile process by leaving out a couple of plugins...

-FileManager,-NassiShneiderman

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

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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Code::Blocks On macOS
« Reply #5 on: May 12, 2017, 08:32:58 am »
There are problems in the mac builds. I'll look at those hopefully this weekend.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]