MantisBT - Zandronum
View Issue Details
0003530Zandronum[All Projects] Bugpublic2018-10-03 14:132018-11-05 21:11
Torr Samaho 
Apple MacOSX10.13
0003530: Various compilation errors with Xcode 10
While I was compiling zandronum-stable on OSX High Sierra with the tools from XCode 10, I got these errors:


FAILED: src/CMakeFiles/zdoom.dir/textures/jpegtexture.o
/Applications/ -DDISABLE_SSE -DDYN_FLUIDSYNTH -DHAVE_FLUIDSYNTH -DNEED_STRUPR=1 -DNOASM -DNO_GTK=1 -DNO_SERVER_GUI=1 -D__forceinline=inline -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -I/usr/local/include/SDL -I"/Developer/FMOD Programmers API Mac/api/inc" -I../lzma/C -I/usr/local/include -I/usr/local/Cellar/openssl/1.0.2o_2/include -Isrc -I../src/. -I../src/g_doom -I../src/g_heretic -I../src/g_hexen -I../src/g_raven -I../src/g_strife -I../src/g_shared -I../src/huffman -I../src/Linux -I../src/oplsynth -I../src/sound -I../src/textures -I../src/thingdef -I../src/timidity -I../src/xlat -I../src/../gdtoa -I../src/../dumb/include -I../src/../sqlite -I../src/../upnpnat -Igdtoa -I../src/sdl -I. -stdlib=libc++ -std=c++14 -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -Wno-inconsistent-missing-override -fno-rtti -fomit-frame-pointer -O3 -DNDEBUG -MD -MT src/CMakeFiles/zdoom.dir/textures/jpegtexture.o -MF src/CMakeFiles/zdoom.dir/textures/jpegtexture.o.d -o src/CMakeFiles/zdoom.dir/textures/jpegtexture.o -c ../src/textures/jpegtexture.cpp
../src/textures/jpegtexture.cpp:96:9: error: cannot initialize return object of type 'boolean' with an rvalue of type 'int'
        return TRUE;
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:164:18: note: expanded from macro 'TRUE'
    #define TRUE 1
../src/textures/jpegtexture.cpp:385:3: error: no matching function for call to 'jpeg_read_header'
                jpeg_read_header(&cinfo, TRUE);
/usr/local/include/jpeglib.h:1039:13: note: candidate function not viable: no known conversion from 'int' to 'boolean' for 2nd argument
EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
../src/textures/jpegtexture.cpp:487:3: error: no matching function for call to 'jpeg_read_header'
                jpeg_read_header(&cinfo, TRUE);
/usr/local/include/jpeglib.h:1039:13: note: candidate function not viable: no known conversion from 'int' to 'boolean' for 2nd argument
EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
3 errors generated.


[5/12] Building CXX object src/CMakeFiles/zdoom.dir/p_acs.o
FAILED: src/CMakeFiles/zdoom.dir/p_acs.o
/Applications/ -DDISABLE_SSE -DDYN_FLUIDSYNTH -DHAVE_FLUIDSYNTH -DNEED_STRUPR=1 -DNOASM -DNO_GTK=1 -DNO_SERVER_GUI=1 -D__forceinline=inline -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -I/usr/local/include/SDL -I"/Developer/FMOD Programmers API Mac/api/inc" -I../lzma/C -I/usr/local/include -I/usr/local/Cellar/openssl/1.0.2o_2/include -Isrc -I../src/. -I../src/g_doom -I../src/g_heretic -I../src/g_hexen -I../src/g_raven -I../src/g_strife -I../src/g_shared -I../src/huffman -I../src/Linux -I../src/oplsynth -I../src/sound -I../src/textures -I../src/thingdef -I../src/timidity -I../src/xlat -I../src/../gdtoa -I../src/../dumb/include -I../src/../sqlite -I../src/../upnpnat -Igdtoa -I../src/sdl -I. -stdlib=libc++ -std=c++14 -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -Wno-inconsistent-missing-override -fno-rtti -fomit-frame-pointer -O3 -DNDEBUG -MD -MT src/CMakeFiles/zdoom.dir/p_acs.o -MF src/CMakeFiles/zdoom.dir/p_acs.o.d -o src/CMakeFiles/zdoom.dir/p_acs.o -c ../src/p_acs.cpp
../src/p_acs.cpp:2096:20: error: call to 'LittleShort' is ambiguous
        unsigned count = (LittleShort(((unsigned *)chunk)[1]) - 2) / 4;
../src/./m_swap.h:34:14: note: candidate function
inline short LittleShort(short x)
../src/./m_swap.h:39:23: note: candidate function
inline unsigned short LittleShort(unsigned short x)
../src/./m_swap.h:44:14: note: candidate function
inline short LittleShort(int x)
1 error generated.

The first error comes from the fact that jpegtexture.cpp includes m_swap.h (not directly), which includes all CoreFoundation, which overrides the values of TRUE and FALSE which were defined by the jpeg library. It seems gzdoom master already have taken care of that, so we'll have to check which changes to backport here.

I don't know about the second error. Probably that's what Blzut3 was talking about recently?
No tags attached.
Issue History
2018-10-03 14:13Edward-sanNew Issue
2018-10-03 14:13Edward-sanStatusnew => assigned
2018-10-03 14:13Edward-sanAssigned To => Blzut3
2018-10-04 03:27Blzut3Note Added: 0019899
2018-10-07 19:15Edward-sanNote Added: 0019994
2018-10-07 19:30Edward-sanNote Edited: 0019994bug_revision_view_page.php?bugnote_id=19994#r12177
2018-10-07 19:52Blzut3Note Added: 0019995
2018-10-07 19:54Blzut3Assigned ToBlzut3 => Torr Samaho
2018-10-14 09:13Torr SamahoNote Added: 0020121
2018-10-14 15:44Edward-sanNote Added: 0020124
2018-10-17 01:03Blzut3Note Added: 0020128
2018-10-17 23:58Blzut3Note Added: 0020132
2018-10-29 18:37Edward-sanNote Added: 0020167
2018-10-29 18:44Edward-sanStatusassigned => resolved
2018-10-29 18:44Edward-sanFixed in Version => 3.1
2018-10-29 18:44Edward-sanResolutionopen => fixed
2018-11-01 17:52Edward-sanStatusresolved => assigned
2018-11-01 17:52Edward-sanResolutionfixed => open
2018-11-01 17:52Edward-sanFixed in Version3.1 =>
2018-11-05 21:11Edward-sanNote Added: 0020173
2018-11-05 21:11Edward-sanStatusassigned => resolved
2018-11-05 21:11Edward-sanFixed in Version => 3.1
2018-11-05 21:11Edward-sanResolutionopen => fixed

2018-10-04 03:27   
The second one is the one I get.
2018-10-07 19:15   
(edited on: 2018-10-07 19:30)
Error 1) is addressed by these two commits: [^] and [^] .

Torr, can you check if the backport can be done?

[edit] Blzut3, do these changes work with the version you use to build the executables?

2018-10-07 19:52   
Those combined with back porting [^] fixes it for me.
Torr Samaho   
2018-10-14 09:13   
Backporting those changes was no problem, but I could only test it under Windows. I pushed everything to the sandbox. Can you confirm that this works as intended under macOS? Then I'll push it to the main repo.
2018-10-14 15:44   
The errors are cleaned, but actually I'm getting an error at link time (I hope it's a trivial thing): [^]
2018-10-17 01:03   
Looks like user error. You're compiling for x86_64 when I think the version of FMOD you're using is 32-bit only.
2018-10-17 23:58   
Confirmed that it works fine on my setup.
2018-10-29 18:37   
I managed to fix it by using the newest fmod version, which is found here. Both compilation and execution work fine.
2018-11-05 21:11   
The following commits were added to zandronum-stable: 1, 2 and 3.