3dfxdev / EDGE

EDGE Source Code
http://edge2.sf.net
74 stars 10 forks source link

fails to build on os x #46

Closed jmtd closed 6 years ago

jmtd commented 7 years ago
$ make -f Makefiles/Makefile.osx
mkdir -p obj_macosx/coal
mkdir -p obj_macosx/ddf
mkdir -p obj_macosx/deh_edge
mkdir -p obj_macosx/edge
mkdir -p obj_macosx/md5_conv
mkdir -p obj_macosx/md5_conv/kmq2
mkdir -p obj_macosx/epi
mkdir -p obj_macosx/glbsp
mkdir -p obj_macosx/timidity
mkdir -p obj_macosx/macosx
g++ -O3 -ffast-math -fno-strict-aliasing -Wall -pipe -msse2 -mfpmath=sse -I. -DDEVELOPERS -DSSE2  -DMACOSX -iframework/Library/Frameworks -D_GNU_SOURCE=1 -D_THREAD_SAFE -Ilib_macosx/libpng -Ilib_macosx/libjpeg-turbo/include -I/usr/local/include -DUSE_OGG -I/usr/local/include/libcpuid -o obj_macosx/edge/p_setup.o -c src/p_setup.cc
src/p_setup.cc:1669:26: error: use of undeclared identifier 'uint'; did you mean 'int'?
 int oVerts = ((u32_t)(*(uint *)td));
                         ^~~~
                         int
src/p_setup.cc:1669:31: error: expected '(' for function-style cast or type construction
 int oVerts = ((u32_t)(*(uint *)td));
                         ~~~~ ^
src/p_setup.cc:1669:32: error: expected expression
 int oVerts = ((u32_t)(*(uint *)td));
                               ^
src/p_setup.cc:1678:26: error: use of undeclared identifier 'uint'; did you mean 'int'?
 int nVerts = ((u32_t)(*(uint *)td));
                         ^~~~
                         int
src/p_setup.cc:1678:31: error: expected '(' for function-style cast or type construction
 int nVerts = ((u32_t)(*(uint *)td));
                         ~~~~ ^
src/p_setup.cc:1678:32: error: expected expression
 int nVerts = ((u32_t)(*(uint *)td));
                               ^
src/p_setup.cc:1744:23: error: use of undeclared identifier 'uint'; did you mean 'int'?
   v1num = ((u32_t)(*(uint*)td));
                      ^~~~
                      int
src/p_setup.cc:1744:27: error: expected '(' for function-style cast or type construction
   v1num = ((u32_t)(*(uint*)td));
                      ~~~~^
src/p_setup.cc:1744:28: error: expected expression
   v1num = ((u32_t)(*(uint*)td));
                           ^
src/p_setup.cc:1755:23: error: use of undeclared identifier 'uint'; did you mean 'int'?
   v1num = ((u32_t)(*(uint*)td));
                      ^~~~
                      int
src/p_setup.cc:1755:27: error: expected '(' for function-style cast or type construction
   v1num = ((u32_t)(*(uint*)td));
                      ~~~~^
src/p_setup.cc:1755:28: error: expected expression
   v1num = ((u32_t)(*(uint*)td));
                           ^
src/p_setup.cc:1766:21: error: expected ')'
  if (v1num < (uint)numvertexes)
                    ^
src/p_setup.cc:1766:6: note: to match this '('
  if (v1num < (uint)numvertexes)
     ^
src/p_setup.cc:1766:16: error: use of undeclared identifier 'uint'
  if (v1num < (uint)numvertexes)
               ^
src/p_setup.cc:1856:2: warning: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
 delete ss_temp;
 ^
       []
src/p_setup.cc:1712:17: note: allocated with 'new[]' here
 int *ss_temp = new int[numsubsectors];
                ^
src/p_setup.cc:1883:24: error: use of undeclared identifier 'uint'; did you mean 'int'?
 numnodes = ((u32_t)(*(uint*)td));
                       ^~~~
                       int
src/p_setup.cc:1883:28: error: expected '(' for function-style cast or type construction
 numnodes = ((u32_t)(*(uint*)td));
                       ~~~~^
src/p_setup.cc:1883:29: error: expected expression
 numnodes = ((u32_t)(*(uint*)td));
                            ^
src/p_setup.cc:1932:33: error: use of undeclared identifier 'uint'; did you mean 'int'?
   nd->children[j] = ((u32_t)(*(uint*)td));
                                ^~~~
                                int
src/p_setup.cc:1932:37: error: expected '(' for function-style cast or type construction
   nd->children[j] = ((u32_t)(*(uint*)td));
                                ~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [obj_macosx/edge/p_setup.o] Error 1
Corbachu commented 7 years ago

Sorry for the delay here.

This "bug" was affected under Visual Studio, which I remember. Basically, this was worked around via src/i_defs.h, in Win32:

#ifdef _MSC_VER
#define strdup _strdup
#define stricmp _stricmp
#define strnicmp _strnicmp
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#define uint unsigned int
#endif

So, I would (as to test), pop in the last line: #define uint unsigned int, into p_setup.cc and see if that makes your compilation succeed.

If so, then it needs to be added in i_defs.h as a MacOSX define.

Please let me know if that helps.

madame-rachelle commented 6 years ago

It appears this bug was addressed in this commit: https://github.com/3dfxdev/hyper3DGE/commit/69badbc1d332e938d116efac84c2793828e08767 - Travis says it builds now - can confirm? (Will need to use CMake from now on, though)

jmtd commented 6 years ago

Thanks, sorry I didnt' respond to your July message. I'll take a look at this Tomorrow.

jmtd commented 6 years ago

Hey, using cmake on a fresh clone and I don't hit this problem: I do hit a linking problem that is alluded to in the travis config, but I imagine I could figure that out with a bit more time, so I guess we can consider this particular issue closed. Thanks!