[GEM-dev] Compiling Gem from git on osx mavericks

Nicolas Montgermont nicolas_montgermont at yahoo.fr
Fri Apr 25 11:44:32 CEST 2014


Le 24/04/2014 15:52, IOhannes m zmölnig a écrit :
>
>
>
> well, this basically means that the windowing code as found in
> src/Base/GemWinCreateMac.cpp has reached it's end of life, even when
> doing a legacy i386-only build.
>
> it's probably time to entirely remove the old legacy windowing code, and
> switch to the new one found in src/Output.
>
> i *guess* the easiest way to do so (for you, right now), is to simply:
> - remove the line containing GemWinCreateMac.cpp from src/Base/Makefile.am
> - remove the line containing gemwin.cpp from src/Control/Makefile.am
>
> - add Gem's abstractions (containing gemwin.pd and the like) to your
> search-path
>
I tried that.

--
first comment (as seen by m.grimm)
this error:

videoBase.cpp:426:3: error: use of undeclared identifier 'select'
  select(0,0,0,0,&sleep);

can be corrected by modifying the beginning of the file

#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif

it works by adding

# include <sys/select.h>

outside of the test but i don't understand it because in my config.h i have
#define HAVE_SYS_SELECT_H 1

------------------------------------------------------------------

second comment
even if i configure with "--without-ftgl"
I have errors on text related objects, for example:
TextBaseFTGL.cpp:57:3: error: member initializer 'm_font' does not name
a non-static data member or base class
  m_font(NULL), m_fontname(NULL)
  ^~~~~~~~~~~~
TextBaseFTGL.cpp:57:17: error: initializer 'm_fontname' does not name a
non-static data member or base class; did you mean the member 'm_fontSize'?
  m_font(NULL), m_fontname(NULL)
                ^~~~~~~~~~
                m_fontSize
./TextBase.h:166:10: note: 'm_fontSize' declared here
  float         m_fontSize;
                ^
TextBaseFTGL.cpp:57:28: warning: implicit conversion of NULL constant to
'float' [-Wnull-conversion]
  m_font(NULL), m_fontname(NULL)
                          ~^~~~
                           0.0
TextBaseFTGL.cpp:57:17: error: multiple initializations given for
non-static member 'm_fontSize'
  m_font(NULL), m_fontname(NULL)
                ^~~~~~~~~~~~~~~~
TextBaseFTGL.cpp:53:26: note: previous initialization is here
  m_dist(1), m_valid(0), m_fontSize(20), m_fontDepth(20), m_precision(3.f),
                         ^~~~~~~~~~~~~~
TextBaseFTGL.cpp:71:18: error: out-of-line definition of
'startRendering' does not match any declaration in 'TextBase'
void TextBase :: startRendering(void) {
                 ^~~~~~~~~~~~~~
TextBaseFTGL.cpp:72:12: error: use of undeclared identifier 'm_font'
  if(NULL==m_font) {
           ^
TextBaseFTGL.cpp:73:8: error: use of undeclared identifier 'm_fontname'
    if(m_fontname)
       ^
TextBaseFTGL.cpp:74:20: error: use of undeclared identifier 'm_fontname'
      fontNameMess(m_fontname->s_name);
                   ^
TextBaseFTGL.cpp:83:18: error: out-of-line definition of 'renderLine'
does not match any declaration in 'TextBase'
void TextBase :: renderLine(const char*line, float dist) {
                 ^~~~~~~~~~
TextBaseFTGL.cpp:85:3: error: use of undeclared identifier 'm_font'
  m_font->BBox(line, x1, y1, z1, x2, y2, z2); // FTGL
  ^
TextBaseFTGL.cpp:94:3: error: use of undeclared identifier 'm_font'
  m_font->Render(line);
  ^
TextBaseFTGL.cpp:98:18: error: out-of-line definition of 'renderLine'
does not match any declaration in 'TextBase'
void TextBase :: renderLine(const wchar_t*line, float dist) {
                 ^~~~~~~~~~
TextBaseFTGL.cpp:100:3: error: use of undeclared identifier 'm_font'
  m_font->BBox(line, x1, y1, z1, x2, y2, z2); // FTGL
  ^
TextBaseFTGL.cpp:109:3: error: use of undeclared identifier 'm_font'
  m_font->Render(line);
  ^
TextBaseFTGL.cpp:116:29: error: use of undeclared identifier 'm_font'
  if (m_theText.empty() || !m_font)return;
                            ^
TextBaseFTGL.cpp:171:6: error: use of undeclared identifier 'm_font'
  if(m_font)delete m_font; m_font=NULL;
     ^
TextBaseFTGL.cpp:171:20: error: use of undeclared identifier 'm_font'
  if(m_font)delete m_font; m_font=NULL;
                   ^
TextBaseFTGL.cpp:171:28: error: use of undeclared identifier 'm_font'
  if(m_font)delete m_font; m_font=NULL;
                           ^
TextBaseFTGL.cpp:172:3: error: use of undeclared identifier 'm_font'
  m_font=makeFont(bufptr);
  ^
TextBaseFTGL.cpp:172:10: error: use of undeclared identifier 'makeFont'
  m_font=makeFont(bufptr);
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src
-DGEM_INTERNAL -DGLEW_BUILD -DPD
-I/Applications/Pd-extended.app/Contents/Resources/src -arch i386 -g -O2
-Os -ffast-math -mmmx -fpascal-strings -MT libBase_la-TextBaseNone.lo
-MD -MP -MF .deps/libBase_la-TextBaseNone.Tpo -c TextBaseNone.cpp -o
libBase_la-TextBaseNone.o >/dev/null 2>&1
1 warning and 20 errors generated.
make[3]: *** [libBase_la-TextBaseFTGL.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
or:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src
-DGEM_INTERNAL -DGLEW_BUILD -DPD
-I/Applications/Pd-extended.app/Contents/Resources/src -arch i386 -g -O2
-Os -ffast-math -mmmx -fpascal-strings -MT libGeos_la-text2d.lo -MD -MP
-MF .deps/libGeos_la-text2d.Tpo -c text2d.cpp  -fno-common -DPIC -o
.libs/libGeos_la-text2d.o
text2d.cpp:143:16: error: out-of-line definition of 'render' does not
match any declaration in 'text2d'
void text2d :: render(GemState*){}
               ^~~~~~
1 error generated.

------------------------------------------------------------------

third:
if i try make -k to get through the text errors, i have a few errors in
imageQT and filmDarwin

/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H
-I. -I../../src  -I../../src   -DPD
-I/Applications/Pd-extended.app/Contents/Resources/src  -arch i386
-framework QuickTime  -g -O2 -Os -ffast-math -mmmx -fpascal-strings -MT
gem_imageQT_la-imageQT.lo -MD -MP -MF .deps/gem_imageQT_la-imageQT.Tpo
-c -o gem_imageQT_la-imageQT.lo `test -f 'imageQT.cpp' || echo
'./'`imageQT.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src -DPD
-I/Applications/Pd-extended.app/Contents/Resources/src -arch i386
-framework QuickTime -g -O2 -Os -ffast-math -mmmx -fpascal-strings -MT
gem_imageQT_la-imageQT.lo -MD -MP -MF .deps/gem_imageQT_la-imageQT.Tpo
-c imageQT.cpp  -fno-common -DPIC -o .libs/gem_imageQT_la-imageQT.o
[...]
imageQT.cpp:267:5: error: no member named 'OffsetRect' in the global
namespace
  ::OffsetRect(&r, -r.left, -r.top);
  ~~^
imageQT.cpp:323:5: error: no type named 'DisposeGWorld' in the global
namespace
  ::DisposeGWorld(gw);         //dispose the offscreen
  ~~^

with a few more in filmDarwin, filmQT and videoDarwin:

filmDarwin.cpp:188:42: error: use of undeclared identifier 'GetGWorldDevice'
  ::SetMovieGWorld(m_movie, m_srcGWorld, GetGWorldDevice(m_srcGWorld));
                                         ^
filmDarwin.cpp:206:5: error: no member named 'GetGWorld' in the global
namespace
  ::GetGWorld(&savedPort, &savedDevice);
  ~~^
filmDarwin.cpp:207:5: error: no member named 'SetGWorld' in the global
namespace
  ::SetGWorld(m_srcGWorld, NULL);
  ~~^
filmDarwin.cpp:208:5: warning: 'GetMovieBox' is deprecated: first
deprecated in OS X 10.9 [-Wdeprecated-declarations]
  ::GetMovieBox(m_movie, &m_srcRect);
    ^
/System/Library/Frameworks/QuickTime.framework/Headers/Movies.h:2550:1:
note: 'GetMovieBox' declared here
GetMovieBox(
^
filmDarwin.cpp:210:16: error: no member named 'GetGWorldPixMap' in the
global namespace
  m_pixMap = ::GetGWorldPixMap(m_srcGWorld);
             ~~^

------------------------------------------------------------------

finally in the output folder i have more or less the same errors than
before, but this time in gemmacwindow.cpp:

libtool: link: g++ -Wl,-undefined -Wl,dynamic_lookup -o
.libs/gemglutwindow.pd_darwin -bundle 
.libs/gemglutwindow_la-gemglutwindow.o   -lstdc++ -framework QuickTime
-framework Carbon -framework Cocoa -framework AGL
-L/Applications/Pd-extended.app/Contents/Resources/bin -L../..
-framework GLUT -framework OpenGL -ldl -lz -lm  -arch i386 -O2 -Os -mmmx
-arch i386   -framework QuickTime -framework Carbon -framework Cocoa
-framework AGL -framework GLUT -framework OpenGL
libtool: link: ( cd ".libs" && rm -f "gemglutwindow.la" && ln -s
"../gemglutwindow.la" "gemglutwindow.la" )
/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H
-I. -I../../src  -I../../src  -DPD
-I/Applications/Pd-extended.app/Contents/Resources/src  -arch i386  -g
-O2 -Os -ffast-math -mmmx -fpascal-strings -MT
gemmacwindow_la-gemmacwindow.lo -MD -MP -MF
.deps/gemmacwindow_la-gemmacwindow.Tpo -c -o
gemmacwindow_la-gemmacwindow.lo `test -f 'gemmacwindow.cpp' || echo
'./'`gemmacwindow.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src -DPD
-I/Applications/Pd-extended.app/Contents/Resources/src -arch i386 -g -O2
-Os -ffast-math -mmmx -fpascal-strings -MT
gemmacwindow_la-gemmacwindow.lo -MD -MP -MF
.deps/gemmacwindow_la-gemmacwindow.Tpo -c gemmacwindow.cpp  -fno-common
-DPIC -o .libs/gemmacwindow_la-gemmacwindow.o
[...]
gemmacwindow.cpp:269:3: error: use of undeclared identifier 'GetPort';
did you mean 'CFRunLoopSourceContext1::getPort'?
  GetPort (&cgrafSave);
  ^~~~~~~
  CFRunLoopSourceContext1::getPort
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h:105:19:
note: 'CFRunLoopSourceContext1::getPort' declared here
    mach_port_t (*getPort)(void *info);
                  ^
gemmacwindow.cpp:269:3: error: invalid use of non-static data member
'getPort'
  GetPort (&cgrafSave);
  ^~~~~~~

gemmacwindow.cpp:388:13: error: use of undeclared identifier 'GetMainDevice'
      hGD = GetMainDevice ();
            ^
gemmacwindow.cpp:394:21: error: use of undeclared identifier
'DMGetFirstScreenDevice'
          hDevice = DMGetFirstScreenDevice (true);
                    ^
gemmacwindow.cpp:399:25: error: use of undeclared identifier
'DMGetNextScreenDevice'
              hDevice = DMGetNextScreenDevice (hDevice, true);
                        ^
gemmacwindow.cpp:417:17: error: use of undeclared identifier
'DMGetFirstScreenDevice'
          hGD = DMGetFirstScreenDevice (true);
                ^
gemmacwindow.cpp:420:34: error: use of undeclared identifier
'DMGetNextScreenDevice'
              GDHandle hGDNext = DMGetNextScreenDevice (hGD, true);
                                 ^
gemmacwindow.cpp:438:13: error: use of undeclared identifier
'DMGetFirstScreenDevice'
      hGD = DMGetFirstScreenDevice (true);
            ^
gemmacwindow.cpp:446:21: error: use of undeclared identifier
'DMGetNextScreenDevice'
              hGD = DMGetNextScreenDevice (hGD, true);
                    ^
[...]

Is this solvable somehow? I make a branch on github to track changes to
compile on osx.
Thanks in advance and sorry for this long mail
n

-- 
http://www.nimon.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20140425/4bacfd63/attachment-0001.htm>


More information about the GEM-dev mailing list