OS X Compilation (again!)

Olly Betts olly at survex.com
Thu Jan 16 21:44:09 GMT 2014


On Wed, Jan 15, 2014 at 09:56:22PM -0500, David A. Riggs wrote:
> On Wed, Jan 15, 2014 at 6:21 PM, Olly Betts <olly at survex.com> wrote:
> >
> > Does dropping --static help?  i.e.:
> >
> > /usr/local/bin/wx-config --libs --cflags --cxxflags core,gl,html
> >
> > If so, the disk image the script builds won't be self-contained, but the
> > build shouldn't otherwise be affected by using a dynamically linked wx
> > (and it's better in many ways).
> 
> Yes, removing '--static' from `buildmacosx.sh` did allow it to work
> with my Homebrew version of wx!
> 
> The bad news is that Survex wouldn't compile with either the brewed wx
> 3.0.0.0 or 2.9.5.0. I also used some Homebrew magic to attempt to roll
> all the way back to wx 2.8.10, but that old "recipe" failed to invoke
> the `clang` compiler properly, and would not install on OS X
> Mavericks.
> 
> I've attached the build log for compiling with --no-install-wx against
> my Homebrewed wx 3.0.0 (previous attachment had a .log extension, and
> my email client apparently gave it a "application/octet-stream"
> mimetype). This is probably useless since Survex isn't ported to wx
> 3.0 in general.

Survex works pretty well with wx 3.0 - the Debian package uses wx 3.0,
as do recent Windows builds.  There were a few assertion dialogs
appearing after the move (because wx 3.0 enables wx's debug mode by
default), but all but one of the ones that have been reported are fixed
in 1.2.10, and the remaining one is fixed in the git repo.

> I'll carry on attempting to find a solution to getting a successfully
> compiled wx 2.8 on OS X Mavericks.

I'd really advise working on wx 3.0 at this point.

> gcc -arch i386 -DHAVE_CONFIG_H -I. -I..    -Wall -W -Wunused -Wshadow -Wpointer-arith      -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wnested-externs      -Wcast-align -g -O2 -MT cad3d.o -MD -MP -MF .deps/cad3d.Tpo -c -o cad3d.o cad3d.c
> cad3d.c:202:10: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
>    layer = layer;
>    ~~~~~ ^ ~~~~~

These are all harmless (ironically, the self-assignment is a common
idiom to avoid an "unused function parameter" warning).

> In file included from aven.cc:29:
> ./log.h:28:10: warning: 'MyLogWindow::DoLogText' hides overloaded virtual function [-Woverloaded-virtual]
>     void DoLogText(const wxChar *msg);
>          ^
> /usr/local/Cellar/wxmac/3.0.0.0/include/wx-3.0/wx/log.h:605:18: note: hidden overloaded virtual function 'wxLog::DoLogText' declared here
>     virtual void DoLogText(const wxString& msg);
>                  ^
> In file included from aven.cc:30:
> In file included from ./mainfrm.h:35:
> ./gfxcore.h:493:10: warning: 'GfxCore::SetCursor' hides overloaded virtual function [-Woverloaded-virtual]
>     void SetCursor(GfxCore::cursor new_cursor);
>          ^
> /usr/local/Cellar/wxmac/3.0.0.0/include/wx-3.0/wx/osx/window.h:90:18: note: hidden overloaded virtual function 'wxWindow::SetCursor' declared here
>     virtual bool SetCursor( const wxCursor &cursor );
>                  ^
> In file included from aven.cc:30:
> ./mainfrm.h:268:10: warning: 'MainFrm::CreateToolBar' hides overloaded virtual function [-Woverloaded-virtual]
>     void CreateToolBar();
>          ^
> /usr/local/Cellar/wxmac/3.0.0.0/include/wx-3.0/wx/osx/frame.h:64:24: note: hidden overloaded virtual function 'wxFrame::CreateToolBar' declared here
>     virtual wxToolBar* CreateToolBar(long style = -1,
>                        ^

These all look OK to me.

> gla-gl.cc:228:2: warning: 'gluErrorString' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
>         CHECK_GL_ERROR("GLAList::need_to_generate", "glGenLists");
>         ^
> gla-gl.cc:566:5: warning: 'gluUnProject' is deprecated: first deprecated in OS X 10.9 - "Use GLKMathUnproject" [-Wdeprecated-declarations]
>     gluUnProject(0.0, 0.0, 0.0, modelview_matrix, projection_matrix, viewport,
>     ^
> gla-gl.cc:1354:5: warning: 'gluPartialDisk' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
>     gluPartialDisk(m_Quadric, 0.0, radius, 36, 1, start, 180.0);
>     ^
> gla-gl.cc:1407:12: warning: 'gluProject' is deprecated: first deprecated in OS X 10.9 - "Use GLKMathProject" [-Wdeprecated-declarations]
>     return gluProject(v.GetX(), v.GetY(), v.GetZ(),
>            ^
> gla-gl.cc:1463:2: warning: 'gluBuild2DMipmaps' is deprecated: first deprecated in OS X 10.9 - "Use glGenerateMipmap" [-Wdeprecated-declarations]
>         gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, // was GL_LUMINANCE
>         ^

I'll have to look at what you're supposed to use instead of these, but
this should be OK at the moment.

> In file included from moviemaker.cc:59:
> ./moviemaker.h:30:22: warning: private field 'oc' is not used [-Wunused-private-field]
>     AVFormatContext *oc;
>                      ^
> ./moviemaker.h:32:9: warning: private field 'out_size' is not used [-Wunused-private-field]
>     int out_size;
>         ^
> ./moviemaker.h:33:14: warning: private field 'frame' is not used [-Wunused-private-field]
>     AVFrame *frame;
>              ^
> ./moviemaker.h:34:20: warning: private field 'outbuf' is not used [-Wunused-private-field]
>     unsigned char *outbuf;
>                    ^
> ./moviemaker.h:35:16: warning: private field 'out' is not used [-Wunused-private-field]
>     AVPicture *out;
>                ^
> ./moviemaker.h:36:20: warning: private field 'pixels' is not used [-Wunused-private-field]
>     unsigned char *pixels;
>                    ^
> ./moviemaker.h:37:17: warning: private field 'sws_ctx' is not used [-Wunused-private-field]
>     SwsContext *sws_ctx;
>                 ^

This is probably due to not having libav (or libffmpeg) installed.  If
that's the case, these are harmless warnings (but you won't be able to
export movies).

> /usr/local/Cellar/wxmac/3.0.0.0/include/wx-3.0/wx/wxcrt.h:577:14: error: call to 'wcsstr' is ambiguous
>     { return wxCRT_StrstrW(haystack, needle); }
>              ^~~~~~~~~~~~~
> /usr/local/Cellar/wxmac/3.0.0.0/include/wx-3.0/wx/wxcrtbase.h:155:26: note: expanded from macro 'wxCRT_StrstrW'
> #define wxCRT_StrstrW    wcsstr
>                          ^~~~~~
> /usr/include/wchar.h:141:10: note: candidate function
> wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
>          ^

I'll have to take a look at the wx 3.0 headers, which aren't on this
machine.  Hopefully not hard to fix, though it might be a wx bug rather
than one in Survex.

It's managed to compile most of the code by this point, so I don't think
we're far off.  I'll see if I can fix it later today, and reduce the
number of warnings at least a bit.

Cheers,
    Olly



More information about the Survex mailing list