Mac OS compile?
#1
Hey all, first post on this amazing community.

So I was giving compiling on Mac OS a go and immediately ran into trouble. Loaded the project into Xcode but "Product->Build" gives me an error "C++ linker does not work with blank $LIBS". I'm wondering if this is a normal and known error with some common fix for the project or if my build environment is fubar.

Back story; my 5-yr old (too young?) loves playing Descent 2 with me, and he wants me to change one of the missiles so that instead of damage, upon impact the robot becomes "silkwing" or "imagespace". Well, as a developer dad, of course I find the source code and get to work. But I'm stuck at Step 0.

Here's the full stack.

Code:
ExternalBuildToolExecution d1x-rebirth-opengl
    cd /Users/bdamm/usr/dxx-rebirth/contrib/..
    export ACTION=
    /usr/local/bin/scons d1x=1 d2x=0 opengl=True debug=True editor=False CXXFLAGS=-O0 builddir=build/d1x-rebirth-opengl ipv6=False use_udp=True use_tracker=True --
===== D1X-Rebirth v0.59.100 0.60.0-beta2-33-g926a7f2a9286* =====
DXX-Archive.2: compiling on 'darwin'/'x86_64' for 'darwin' into build/d1x-rebirth-opengl/
DXX-Archive.2: checking version of C++ compiler 'g++' ... 'Apple LLVM version 7.3.0 (clang-703.0.31)'
DXX-Archive.2: checking path to assembler ... '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as'
DXX-Archive.2: checking version of assembler '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as' ... 'Apple LLVM version 7.3.0 (clang-703.0.31)'
DXX-Archive.2: checking path to linker ... '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld'
DXX-Archive.2: checking version of linker '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld' ... None
DXX-Archive.2:    CXX: 'g++'
DXX-Archive.2:    CPPDEFINES: ['__unix__', ('PHYSFS_DEPRECATED', '')]
DXX-Archive.2:    CPPPATH: ['/Users/bdamm/Library/Frameworks/SDL.framework/Headers', '/Library/Frameworks/SDL.framework/Headers', 'common/include', 'common/main', '.', 'build/d1x-rebirth-opengl/']
DXX-Archive.2:    CPPFLAGS: ['-Wno-sign-compare']
DXX-Archive.2:    CXXFLAGS: ['-g', '-O2', '-ftabstop=4', '-Wall', '-Werror=extra', '-Werror=format=2', '-Werror=missing-braces', '-Werror=missing-include-dirs', '-Werror=uninitialized', '-Werror=undef', '-Werror=pointer-arith', '-Werror=cast-qual', '-Werror=missing-declarations', '-Werror=redundant-decls', '-Werror=vla', '-funsigned-char', '-O0']
DXX-Archive.2:    LIBS: None
DXX-Archive.2:    LINKFLAGS: ['-Wl,-rpath,@loader_path/../Frameworks']
DXX-Archive.2:    $CCACHE_PREFIX: None
DXX-Archive.2:    $DISTCC_HOSTS: None
DXX-Archive.2: checking whether C++ compiler and linker work...no
DXX-Archive.2: checking whether C++ compiler works...yes
DXX-Archive.2: checking whether C++ compiler and linker work with blank $LIBS and blank $LDFLAGS...no
scons: *** C++ compiler works.  C++ linker does not work with specified blank $LIBS and specified $LINKFLAGS.  C++ linker does not work with blank $LIBS and blank $LINKFLAGS.  See build/d1x-rebirth-opengl/sconf.log for details.  Stop.
Command /usr/local/bin/scons failed with exit code 2

Anyone know what this points to?

Thanks!
-Ben
Reply
#2
Kreator tends the OS X build. I think it works, since he recently filed a ticket about a problem running from Finder. The build output says to check the sconf.log. What does that log show?
Reply
#3
Ah ya! Of course, *smack forehead*

That file ends with:
Code:
g++ -c -g -O2 -ftabstop=4 -Wall -Werror=extra -Werror=format=2 -Werror=missing-braces -Werror=missing-include-dirs -Werror=uninitialized -Werror=undef -Werror=pointer-arith -Werror=cast-qual -Werror=missing-declarations -Werror=redundant-decls -Werror=vla -funsigned-char -O0 -Werror -Wno-sign-compare -D__unix__ -DPHYSFS_DEPRECATED= -I/Users/bdamm/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/SDL.framework/Headers -Icommon/include -Icommon/main -I. -Ibuild/d1x-rebirth-opengl -F/Users/bdamm/Library/Frameworks -F/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks build/d1x-rebirth-opengl/.sconf_temp/conftest_2.cpp -o build/d1x-rebirth-opengl/.sconf_temp/conftest_2.o
g++ -g -O2 -ftabstop=4 -Wall -Werror=extra -Werror=format=2 -Werror=missing-braces -Werror=missing-include-dirs -Werror=uninitialized -Werror=undef -Werror=pointer-arith -Werror=cast-qual -Werror=missing-declarations -Werror=redundant-decls -Werror=vla -funsigned-char -O0 -Werror build/d1x-rebirth-opengl/.sconf_temp/conftest_2.o -F/Users/bdamm/Library/Frameworks -F/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks -framework ApplicationServices -framework Cocoa -framework SDL -framework OpenGL -o build/d1x-rebirth-opengl/.sconf_temp/conftest_2
ld: warning: directory not found for option '-F/Users/bdamm/Library/Frameworks'
ld: framework not found SDL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: Configure: no

So I think that means I need to install SDL. I've gone back and re-read the compilation instructions, sure enough there it is. My apologies. SDL 1.2.8... and physFS.

Thanks Smile
Reply
#4
Ok, after installing the needed bits I got a good build! Specifically, I was never able to build SDL 1.2.15 from source (there are bugs that prevent building with El Capitan) but using the binary framework package worked. Same for SDL_mixer (1.2.8 I think). PhysFS 3.0.1 source repository compiled cleanly with just "cmake; make; make install". Held my breath on the Xcode compile and got a clean compile. I took my old Descent data files (from GoG distribution) and copied them over to the build target Contents/Resources, and presto, Descent 1 fired right up! It looks amazing, this game has *NEVER* looked so good. Wow, what amazing work you guys have done. And the menu adjustments are outstanding. And I love the logging and diagnostics. Rebirth indeed!

Next up will be to figure out how to compile or start it as Descent 2. For another day!
Reply
#5
The same source tree can build Descent and Descent 2. From your output, it looks like the Xcode wrapper projects force it to build only one or the other at a time. This is probably because it would be overwhelming to the user to offer all the combinations as individual projects, and the Xcode projects interface lacks the customizeability to let you check off the features you want. I see in source control a target d2x-rebirth-opengl. I expect that will do what you want (but I have no Mac on which to check this).

As for your longer term goal, the text for those cheats is in similar/main/gamecntl.cpp. Look there to trace how the cheats are implemented. Look in similar/main/collide.cpp at apply_damage_to_robot and collide_robot_and_weapon for possible places to detect the missile event. If you want more hints, ask.
Reply
#6
Poking around collide_robot_and_weapon I tried a bunch of stuff that didn't work but ultimately ended up with:
Code:
   int jolly_strike = !robot_is_companion(robptr) && (get_weapon_id(weapon) == weapon_id_type::CONCUSSION_ID);
   if(jolly_strike){
       powerup_basic_str(30, 30, 30, 1, "Jolly missile strike!");
        robot->control_type=0;
   }

Along the way I learned a lot about the ai subsystem. Next task: Make the robots actually turn to the nearest wall then either hold station or spin. We shall see Smile

Thanks for the help!
Reply
#7
Hello!

I'm also having trouble compiling on Mac OS, and not being very familiar with C++ I could definitely use some help. Smile
(By the way, here's what I'm working on: https://twitter.com/mast4461/status/1173248000031899648)

Initially I had the same troubles with SDL.

Then I had trouble with __builtin_FILE() being undefined. The build script supposedly checks for this and is supposed to define DXX_HAVE_CXX_BUILTIN_FILE_LINE only if the function is available, but the macro (?) is also defined unconditionally in dxxsconf.h so the check is irrelevant. I disabled the unconditional check and seemingly got past this problem.

Next up seems to be some ambiguous references and implicit instantiations of undefined templates, none of which I know anything about... Here's the latest build console output:

Code:
Mon Sep 23 23:59:08 CEST 2019
scons: Reading SConscript files ...
===== D2X-Rebirth v0.61.0 0.60.0-beta2-567-g7832e2d98941* =====
DXX-Archive.2: compiling on 'darwin'/'x86_64' for 'darwin' into build/
DXX-Archive.2: checking version of C++ compiler 'g++' ... 'Apple LLVM version 10.0.1 (clang-1001.0.46.4)'
DXX-Archive.2: checking path to assembler ... '/Library/Developer/CommandLineTools/usr/bin/as'
DXX-Archive.2: checking version of assembler '/Library/Developer/CommandLineTools/usr/bin/as' ... 'Apple LLVM version 10.0.1 (clang-1001.0.46.4)'
DXX-Archive.2: checking path to linker ... '/Library/Developer/CommandLineTools/usr/bin/ld'
DXX-Archive.2: checking version of linker '/Library/Developer/CommandLineTools/usr/bin/ld' ... None
DXX-Archive.2:    CXX: 'g++'
DXX-Archive.2:    CPPDEFINES: ['__unix__', ('PHYSFS_DEPRECATED', '')]
DXX-Archive.2:    CPPPATH: ['/Users/martin/Library/Frameworks/SDL.framework/Headers', '/Library/Frameworks/SDL.framework/Headers', 'common/include', 'common/main', '.', 'build/']
DXX-Archive.2:    CPPFLAGS: ['-Wno-sign-compare']
DXX-Archive.2:    CXXFLAGS: ['-g', '-O2', '-ftabstop=4', '-Wall', '-Werror=extra', '-Werror=format=2', '-Werror=missing-braces', '-Werror=missing-include-dirs', '-Werror=uninitialized', '-Werror=undef', '-Werror=pointer-arith', '-Werror=cast-qual', '-Werror=missing-declarations', '-Werror=redundant-decls', '-Werror=vla', '-funsigned-char']
DXX-Archive.2:    LIBS: None
DXX-Archive.2:    LINKFLAGS: ['-Wl,-rpath,@loader_path/../Frameworks']
DXX-Archive.2:    $CCACHE_PREFIX: None
DXX-Archive.2:    $DISTCC_HOSTS: None
DXX-Archive.2: checking whether C++ compiler and linker work...(cached) yes
DXX-Archive.2: checking whether C++ compiler accepts -std=gnu++14...(cached) yes
DXX-Archive.2: checking endian to use...little
DXX-Archive.2: checking whether to enable word alignment fixups...no
DXX-Archive.2: building with OpenGL
DXX-Archive.2: checking whether to enable release options...yes
DXX-Archive.2: checking whether to enable memory allocation tracking...no
DXX-Archive.2: checking whether to enable level editor...no
DXX-Archive.2: checking whether to enable IPv6 support...no
DXX-Archive.2: checking whether to enable multiplayer over UDP...yes
DXX-Archive.2: checking whether to enable UDP game tracker...yes
DXX-Archive.2: checking how to handle ADL MIDI...disabled
DXX-Archive.2: checking how to format screenshots...screenshot support disabled
DXX-Archive.2: checking for usable library physfs...(cached) yes
DXX-Archive.2: checking SDL pkg-config sdl
DXX-Archive.2: using pkg-config at discovered path /usr/local/bin/pkg-config
DXX-Archive.2: reading sdl version from ('/usr/local/bin/pkg-config', '--modversion', 'sdl')
DXX-Archive.2: SDL version: '1.2.15'
DXX-Archive.2: reading SDL settings from ('/usr/local/bin/pkg-config', '--cflags', '--libs', 'sdl')
DXX-Archive.2: SDL settings: {'LIBS': ['SDLmain', 'SDL'], 'LINKFLAGS': ['-Wl,-framework,Cocoa'], 'CPPDEFINES': [['_GNU_SOURCE', '1'], '_THREAD_SAFE'], 'CPPPATH': ['/usr/local/include/SDL'], 'LIBPATH': ['/usr/local/lib']}
DXX-Archive.2: checking whether to enable joystick support...yes
DXX-Archive.2: checking for usable library SDL with OpenGL...(cached) yes
DXX-Archive.2: checking whether to use SDL_mixer...yes
DXX-Archive.2: checking SDL_mixer pkg-config SDL_mixer
DXX-Archive.2: reading SDL_mixer version from ('/usr/local/bin/pkg-config', '--modversion', 'SDL_mixer')
DXX-Archive.2: SDL_mixer version: '1.2.12'
DXX-Archive.2: reading SDL_mixer settings from ('/usr/local/bin/pkg-config', '--cflags', '--libs', 'SDL_mixer')
DXX-Archive.2: SDL_mixer settings: {'LIBS': ['SDL_mixer', 'SDLmain', 'SDL'], 'LINKFLAGS': ['-Wl,-framework,Cocoa'], 'CPPDEFINES': [['_GNU_SOURCE', '1'], '_THREAD_SAFE'], 'CPPPATH': ['/usr/local/include/SDL'], 'LIBPATH': ['/usr/local/lib']}
DXX-Archive.2: checking for usable library SDL_mixer...(cached) yes
DXX-Archive.2: checking whether C++ compiler accepts {} initialization...(cached) yes
DXX-Archive.2: checking whether compiler accepts extended identifiers by default...(cached) yes
DXX-Archive.2: checking whether compiler optimizes function __attribute__((__error__))...(cached) no
DXX-Archive.2: checking whether compiler accepts function __attribute__((__error__))...(cached) no
DXX-Archive.2: checking whether compiler implements __builtin_bswap{16,32,64} functions...(cached) yes
DXX-Archive.2: checking whether compiler optimizes __builtin_constant_p...(cached) no
DXX-Archive.2: checking whether compiler accepts __builtin_constant_p...(cached) yes
DXX-Archive.2: checking whether compiler accepts __builtin_expect...(cached) yes
DXX-Archive.2: checking whether compiler accepts __builtin_FILE, __builtin_LINE...(cached) no
DXX-Archive.2: checking whether compiler optimizes __builtin_object_size...(cached) yes
DXX-Archive.2: checking whether compiler understands embedded compound statements...(cached) yes
DXX-Archive.2: checking whether compiler allows dead calls to undefined functions in the anonymous namespace...(cached) no
DXX-Archive.2: checking for function __attribute__((always_inline))...(cached) yes
DXX-Archive.2: checking for function __attribute__((alloc_size))...(cached) yes
DXX-Archive.2: checking for function __attribute__((cold))...(cached) yes
DXX-Archive.2: checking for function __attribute__((format_arg))...(cached) yes
DXX-Archive.2: checking for function __attribute__((format(printf)))...(cached) yes
DXX-Archive.2: checking for function __attribute__((malloc))...(cached) yes
DXX-Archive.2: checking for function __attribute__((nonnull))...(cached) yes
DXX-Archive.2: checking for function __attribute__((noreturn))...(cached) yes
DXX-Archive.2: checking for function __attribute__((used))...(cached) yes
DXX-Archive.2: checking for function __attribute__((unused))...(cached) yes
DXX-Archive.2: checking for function __attribute__((warn_unused_result))...(cached) yes
DXX-Archive.2: checking whether compiler optimizes function __attribute__((__warning__))...(cached) no
DXX-Archive.2: checking whether compiler accepts function __attribute__((__warning__))...(cached) no
DXX-Archive.2: checking for C++11 intrinsic static_assert when true...(cached) yes
DXX-Archive.2: checking for C++11 intrinsic static_assert when false...(cached) yes
DXX-Archive.2: checking whether compiler handles classes from "using namespace"...(cached) no
DXX-Archive.2: checking for required C++11 features...(cached) yes
DXX-Archive.2: checking when to pre-compile own headers...never
DXX-Archive.2: checking when to pre-compile system headers...never
DXX-Archive.2: checking for explicitly deleted functions with named parameters...(cached) yes
DXX-Archive.2: checking for C++11 function addressof()...(cached) yes
DXX-Archive.2: checking for C++14 exchange...(cached) yes
DXX-Archive.2: checking for depth-efficient C++14 integer_sequence...(cached) yes
DXX-Archive.2: checking for C++14 make_unique...(cached) yes
DXX-Archive.2: checking for C++11 inherited constructors with good unique_ptr<T[]> support...(cached) yes
DXX-Archive.2: checking whether compiler handles 20-element tuples...(cached) yes
DXX-Archive.2: checking whether to use overwrite poisoning...(cached) no
DXX-Archive.2: checking whether to use Valgrind poisoning...(cached) no
DXX-Archive.2: checking whether to format std::size_t with "%zu"...(cached) yes
DXX-Archive.2: checking whether compiler argument -Wuseless-cast works with SDL and with constructor inheritance...(cached) no
DXX-Archive.2: checking whether compiler accepts -Wuseless-cast...(cached) no
DXX-Archive.2: checking whether to cast operator-(T*,T*) to int...(cached) yes
DXX-Archive.2: checking for strcasecmp...(cached) yes
DXX-Archive.2: checking for getaddrinfo...(cached) yes
DXX-Archive.2: checking for struct timespec...(cached) yes
DXX-Archive.2: checking for Boost.Config...(cached) no
DXX-Archive.2: checking for -Wno-implicit-fallthrough...(cached) yes
DXX-Archive.2: checking whether compiler allows lambda capture of local references...(cached) no
DXX-Archive.2: checking whether compiler accepts preferred options...(cached) no
DXX-Archive.2: checking whether compiler accepts option -fvisibility=hidden...(cached) no
DXX-Archive.2: checking whether compiler accepts option -Wduplicated-branches...(cached) no
DXX-Archive.2: checking whether compiler accepts option -Wduplicated-cond...(cached) no
DXX-Archive.2: checking whether compiler accepts option -Wsuggest-attribute=noreturn...(cached) no
DXX-Archive.2: checking whether compiler accepts option -Wlogical-op...(cached) no
DXX-Archive.2: checking whether compiler accepts option -Wold-style-cast...(cached) no
DXX-Archive.2: checking whether to build runtime tests...no
DXX-Archive.2: CXX: 'g++'
DXX-Archive.2: CPPDEFINES: ['__unix__', ('PHYSFS_DEPRECATED', ''), ('NDEBUG',), ('RELEASE',)]
DXX-Archive.2: CPPPATH: ['/Users/martin/Library/Frameworks/SDL.framework/Headers', '/Library/Frameworks/SDL.framework/Headers', 'common/include', 'common/main', '.', 'build/', '/usr/local/include/SDL', '/Users/martin/Library/Frameworks/SDL_mixer.framework/Headers', '/Library/Frameworks/SDL_mixer.framework/Headers']
DXX-Archive.2: CPPFLAGS: ['-Wno-sign-compare']
DXX-Archive.2: CXXFLAGS: ['-g', '-O2', '-ftabstop=4', '-Wall', '-Werror=extra', '-Werror=format=2', '-Werror=missing-braces', '-Werror=missing-include-dirs', '-Werror=uninitialized', '-Werror=undef', '-Werror=pointer-arith', '-Werror=cast-qual', '-Werror=missing-declarations', '-Werror=redundant-decls', '-Werror=vla', '-funsigned-char', '-std=gnu++14', '-Werror=unused', '-Wno-implicit-fallthrough', '-Wno-unused-lambda-capture']
DXX-Archive.2: LIBS: ['physfs', 'SDL_mixer', 'SDLmain', 'SDL']
DXX-Archive.2: LINKFLAGS: ['-Wl,-rpath,@loader_path/../Frameworks', '-Wl,-framework,Cocoa']
DXX-Archive.2: $CCACHE_PREFIX: None
DXX-Archive.2: $DISTCC_HOSTS: None
D2X-Rebirth.1: compiling on 'darwin'/'x86_64' for 'darwin' into build/ with prefix list ('d2x', '')
D2X-Rebirth.1: default sharepath is None
D2X-Rebirth.1: CXX: 'g++'
D2X-Rebirth.1: CPPDEFINES: ['__unix__', ('PHYSFS_DEPRECATED', ''), ('NDEBUG',), ('RELEASE',), ('DXX_BUILD_DESCENT_II',), ('__STDC_FORMAT_MACROS',), ('DXX_USE_SHAREPATH', 0)]
D2X-Rebirth.1: CPPPATH: ['/Users/martin/Library/Frameworks/SDL.framework/Headers', '/Library/Frameworks/SDL.framework/Headers', 'common/include', 'common/main', '.', 'build/', '/usr/local/include/SDL', '/Users/martin/Library/Frameworks/SDL_mixer.framework/Headers', '/Library/Frameworks/SDL_mixer.framework/Headers', 'd2x-rebirth/main']
D2X-Rebirth.1: CPPFLAGS: ['-Wno-sign-compare']
D2X-Rebirth.1: CXXFLAGS: ['-g', '-O2', '-ftabstop=4', '-Wall', '-Werror=extra', '-Werror=format=2', '-Werror=missing-braces', '-Werror=missing-include-dirs', '-Werror=uninitialized', '-Werror=undef', '-Werror=pointer-arith', '-Werror=cast-qual', '-Werror=missing-declarations', '-Werror=redundant-decls', '-Werror=vla', '-funsigned-char', '-std=gnu++14', '-Werror=unused', '-Wno-implicit-fallthrough', '-Wno-unused-lambda-capture']
D2X-Rebirth.1: LIBS: ['physfs', 'SDL_mixer', 'SDLmain', 'SDL', 'm']
D2X-Rebirth.1: LINKFLAGS: ['-Wl,-rpath,@loader_path/../Frameworks', '-Wl,-framework,Cocoa']
D2X-Rebirth.1: $CCACHE_PREFIX: None
D2X-Rebirth.1: $DISTCC_HOSTS: None
running tool: TOOL_BUNDLE
running tool: TOOL_WRITE_VAL
scons: done reading SConscript files.
scons: Building targets ...
CXX dxx build/ common/arch/sdl/timer.cpp
In file included from common/arch/sdl/timer.cpp:18:
In file included from common/main/multi.h:30:
In file included from common/main/fwd-player.h:23:
In file included from common/main/fwd-object.h:17:
common/main/fwd-segment.h:101:31: error: reference to 'dcx' is ambiguous
DXX_VALPTRIDX_DECLARE_SUBTYPE(dcx::, vertex, vertnum_t, MAX_VERTICES);
                             ^
common/main/fwd-segment.h:54:11: note: candidate found by name lookup is 'dcx'
namespace dcx {
         ^
common/include/dsx-ns.h:85:8: note: candidate found by name lookup is 'dcx::dcx'
   class dcx;  /* dcx declared inside dcx */
         ^
common/include/dsx-ns.h:91:8: note: candidate found by name lookup is '(anonymous namespace)::dcx'
   class dcx;  /* dcx declared inside anonymous */
         ^
In file included from common/arch/sdl/timer.cpp:18:
In file included from common/main/multi.h:30:
In file included from common/main/fwd-player.h:23:
In file included from common/main/fwd-object.h:17:
In file included from common/main/fwd-segment.h:31:
common/include/fwd-valptridx.h:42:12: error: implicit instantiation of undefined template 'valptridx_specialized_types<dcx::vertex>'
   protected valptridx_specialized_types<managed_type>::type
             ^
common/main/fwd-segment.h:123:1: note: in instantiation of template class 'valptridx<dcx::vertex>' requested here
DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEFS(vertex, vert);
^
common/include/fwd-valptridx.h:203:33: note: expanded from macro 'DXX_VALPTRIDX_DEFINE_SUBTYPE_TYPEDEFS'
   using MANAGED_TYPE ## _array = valptridx<MANAGED_TYPE>::array_managed_type; \
                                  ^
common/include/cpp-valptridx.h:17:8: note: template is declared here
struct valptridx_specialized_types;
      ^
In file included from common/arch/sdl/timer.cpp:18:
In file included from common/main/multi.h:30:
In file included from common/main/fwd-player.h:23:
In file included from common/main/fwd-object.h:17:
In file included from common/main/fwd-segment.h:31:
common/include/fwd-valptridx.h:44:37: error: implicit instantiation of undefined template 'valptridx_specialized_types<dcx::vertex>'
   using specialized_types = typename valptridx_specialized_types<managed_type>::type;
                                      ^
common/include/cpp-valptridx.h:17:8: note: template is declared here
struct valptridx_specialized_types;
      ^
In file included from common/arch/sdl/timer.cpp:18:
In file included from common/main/multi.h:38:
common/main/fwd-wall.h:26:31: error: reference to 'dcx' is ambiguous
DXX_VALPTRIDX_DECLARE_SUBTYPE(dcx::, active_door, actdoornum_t, MAX_DOORS);
                             ^
common/main/fwd-wall.h:20:11: note: candidate found by name lookup is 'dcx'
namespace dcx {
         ^
common/include/dsx-ns.h:85:8: note: candidate found by name lookup is 'dcx::dcx'
   class dcx;  /* dcx declared inside dcx */
         ^
common/include/dsx-ns.h:91:8: note: candidate found by name lookup is '(anonymous namespace)::dcx'
   class dcx;  /* dcx declared inside anonymous */
         ^
4 errors generated.
scons: *** [build/common/arch/sdl/timer.o] Error 1
scons: building terminated because of errors.
Failed target count: total=1; targets with enable_build_failure_summary=1: 1
Failed node list:
    build/common/arch/sdl/timer.o
Failed command list:
g++ -c -g -O2 -ftabstop=4 -Wall -Werror=extra -Werror=format=2 -Werror=missing-braces -Werror=missing-include-dirs -Werror=uninitialized -Werror=undef -Werror=pointer-arith -Werror=cast-qual -Werror=missing-declarations -Werror=redundant-decls -Werror=vla -funsigned-char -std=gnu++14 -Werror=unused -Wno-implicit-fallthrough -Wno-unused-lambda-capture -Wno-sign-compare -D__unix__ -DPHYSFS_DEPRECATED= -DNDEBUG -DRELEASE -I/Users/martin/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/SDL.framework/Headers -Icommon/include -Icommon/main -I. -Ibuild -I/usr/local/include/SDL -I/Users/martin/Library/Frameworks/SDL_mixer.framework/Headers -I/Library/Frameworks/SDL_mixer.framework/Headers -F/Users/martin/Library/Frameworks -F/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks "common/arch/sdl/timer.cpp" -o "build/common/arch/sdl/timer.o"

real    0m2.368s
user    0m1.686s
sys    0m0.541s
Mon Sep 23 23:59:11 CEST 2019
Reply
#8
Generally, you are better off posting these reports on Github as project issues. The forum will supposedly be closing Real Soon Now, and reports here will be lost.
(09-23-2019, 10:30 PM)mast4461 Wrote: Then I had trouble with __builtin_FILE() being undefined. The build script supposedly checks for this and is supposed to define DXX_HAVE_CXX_BUILTIN_FILE_LINE only if the function is available, but the macro (?) is also defined unconditionally in dxxsconf.h so the check is irrelevant.
It is not defined for me when I build using clang.
Code:
$ grep DXX_HAVE_CXX_BUILTIN_FILE_LINE build/gcc/dxxsconf.h
#define DXX_HAVE_CXX_BUILTIN_FILE_LINE
$ grep DXX_HAVE_CXX_BUILTIN_FILE_LINE build/clang/dxxsconf.h
$
The SConstruct file agrees with this interpretation. Your posted output seems to indicate that it would have done the right thing:
(09-23-2019, 10:30 PM)mast4461 Wrote:
Code:
DXX-Archive.2: checking whether compiler accepts __builtin_FILE, __builtin_LINE...(cached) no
This is what I would expect for clang, and it should have skipped defining DXX_HAVE_CXX_BUILTIN_FILE_LINE in your dxxsconf.h. Thus, your SConstruct output disagrees with the generated dxxsconf.h here.
(09-23-2019, 10:30 PM)mast4461 Wrote: I disabled the unconditional check and seemingly got past this problem.
What do you mean here?
(09-23-2019, 10:30 PM)mast4461 Wrote: Next up seems to be some ambiguous references and implicit instantiations of undefined templates, none of which I know anything about... Here's the latest stacktrace:
Ambiguous references should not happen either. As a defensive programming technique, I declare some placeholder classes that would ambiguate certain undesirable namespace nesting setups. When the code is correct, the declarations are harmless. If someone tries to introduce improper nesting, the placeholders cause an ambiguous resolution and the build fails. These placeholders confuse clang even when the code is correct, so I don't define them for clang. I have an SConstruct test to detect that the compiler is confused by these:
(09-23-2019, 10:30 PM)mast4461 Wrote:
Code:
DXX-Archive.2: checking whether compiler handles classes from "using namespace"...(cached) no
This test says clang doesn't handle the placeholders, which is what I expect. In turn, it should have set up dxxsconf.h not to use the placeholders. However, since you are getting these errors, that suggests it did not. This is now 2 places where your dxxsconf.h disagrees with what SConstruct said it would generate.

For now, I will blame the undefined template problem on the ambiguous namespace problem. I hope that fixing the ambiguous namespace issue will fix the template problem too.

So the question becomes, what happened that your dxxsconf.h is inconsistent with the results of the SConstruct tests? I see quite a few cached test results. Did you at some point update your compiler in a way that SConstruct did not detect? Do you have multiple dxxsconf.h files lying around, and some of them are wrong? If you clean out all build artifacts and build from a clean base, does the problem persist?
Reply
#9
Thank you for your swift reply, Kp!

I wrote my last post in the middle of the night after a long day, and I do realize now that it shows... I'll make use of your answers, look into your questions and get back to you soon.

Again, thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)