Opened 2 years ago

Last modified 16 months ago

#65885 new defect

wesnoth @1.16.6+debug: Undefined symbols _OBJC_CLASS_$_NSUserNotification, _OBJC_CLASS_$_NSUserNotificationCenter

Reported by: cooljeanius (Eric Gallager) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: wesnoth

Description (last modified by cooljeanius (Eric Gallager))

I noticed rev-upgrade wanted to rebuild it (edit: I think due to a change in which python variant I had boost176-numpy installed with) but couldn't due to being stopped by another failing port, so I tried rebuilding manually and got this error:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_games_wesnoth/wesnoth/work/wesnoth-1.16.6/src/macosx/SDLMain.mm:147:12: warning: 'loadNibNamed:owner:' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
        [NSBundle loadNibNamed:@"SDLMain" owner:NSApp];
                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSNibLoading.h:33:1: note: 'loadNibNamed:owner:' has been explicitly marked deprecated here
+ (BOOL)loadNibNamed:(null_unspecified NSString *)nibName owner:(null_unspecified id)owner API_DEPRECATED("", macos(10.0,10.8));
^
1 warning generated.
[100%] Linking CXX executable ../wesnoth
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_games_wesnoth/wesnoth/work/build/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/wesnoth.dir/link.txt --verbose=ON
/usr/bin/clang++ -Wall -Wextra -Werror=non-virtual-dtor -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wold-style-cast -Wtrampolines -Qunused-arguments -Wno-unknown-warning-option -Wmismatched-tags -Wno-conditional-uninitialized -Wno-unused-lambda-capture -pipe -Os -I/opt/local/include -UNDEBUG -g -fno-limit-debug-info -DDEBUG -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -fPIE -fstack-protector-strong -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -mmacosx-version-min=11.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -lstdc++ -lm -L/opt/local/lib -Wl,-headerpad_max_install_names -g -fno-limit-debug-info -DDEBUG -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -fPIE -Wl,-pie CMakeFiles/wesnoth.dir/wesnoth.cpp.o CMakeFiles/wesnoth.dir/macosx/SDLMain.mm.o -o ../wesnoth  -Wl,-rpath,/opt/local/lib libwesnoth-common.a -Wl,-force_load libwesnoth-widgets.a libwesnoth-client.a libwesnoth-common.a /opt/local/lib/libicudata.dylib /opt/local/lib/libicui18n.dylib /opt/local/lib/libicuuc.dylib -framework AppKit -framework Foundation -framework IOKit -framework Security -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lharfbuzz -lcairo -lfontconfig -lfreetype /opt/local/lib/libvorbisfile.dylib -lSDL2 -lSDL2_image -lSDL2 -lSDL2_mixer -lSDL2 /opt/local/lib/libhistory.dylib /opt/local/libexec/openssl3/lib/libcrypto.dylib /opt/local/libexec/openssl3/lib/libssl.dylib /opt/local/lib/libboost_iostreams-mt.dylib /opt/local/lib/libboost_program_options-mt.dylib /opt/local/lib/libboost_regex-mt.dylib /opt/local/lib/libboost_system-mt.dylib /opt/local/lib/libboost_thread-mt.dylib /opt/local/lib/libboost_random-mt.dylib /opt/local/lib/libboost_coroutine-mt.dylib /opt/local/lib/libboost_locale-mt.dylib /opt/local/lib/libboost_filesystem-mt.dylib -lSDL2_image -lSDL2_mixer /opt/local/lib/libhistory.dylib /opt/local/libexec/openssl3/lib/libcrypto.dylib /opt/local/lib/libboost_chrono-mt.dylib /opt/local/lib/libboost_date_time-mt.dylib /opt/local/lib/libboost_atomic-mt.dylib /opt/local/lib/libboost_context-mt.dylib 
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_NSUserNotification", referenced from:
      objc-class-ref in libwesnoth-client.a(apple_notification.mm.o)
  "_OBJC_CLASS_$_NSUserNotificationCenter", referenced from:
      objc-class-ref in libwesnoth-client.a(apple_notification.mm.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [wesnoth] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_games_wesnoth/wesnoth/work/build'
make[1]: *** [src/CMakeFiles/wesnoth.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_games_wesnoth/wesnoth/work/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_games_wesnoth/wesnoth/work/build'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_games_wesnoth/wesnoth/work/build" && /usr/bin/make -j16 -w all VERBOSE=ON 
Exit code: 2
Error: Failed to build wesnoth: command execution failed
DEBUG: Error code: CHILDSTATUS 30178 2

I'm on Big Sur with Xcode 13.

Attachments (1)

wesnoth_1_16_6_main.log (2.2 MB) - added by cooljeanius (Eric Gallager) 2 years ago.
main.log for Wesnoth

Change History (5)

Changed 2 years ago by cooljeanius (Eric Gallager)

Attachment: wesnoth_1_16_6_main.log added

main.log for Wesnoth

comment:1 Changed 2 years ago by cooljeanius (Eric Gallager)

Description: modified (diff)

comment:2 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Hmm, we built this version of this port successfully on all systems 10.7 and later on the buildbot on September 8, however we did not use the +debug variant so we were compiling with -NDEBUG (however the Portfile contains the comment # src/global.hpp:28:2: error: "Compilation with NDEBUG defined isn't supported, Wesnoth depends on asserts." and adds -UNDEBUG to CPPFLAGS to counteract it) while you are using the +debug variant so you are compiling with -g -fno-limit-debug-info -DDEBUG.

comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

I've tried building this port with +debug on Catalina and on Monterey x86_64 and it succeeds on both, so I don't know why this is failing for you. Does it work without +debug if you build from source (-s)? (I assume it will successfully pull our binary if you don't request a build from source.)

You reported a similar problem in quassel and other ports in #63612 in which you wondered if it was a problem specific to your computer, which I now tend to agree with, though I don't know what it could be. Maybe try reinstalling the version of the command line tools that most closely matches your Xcode version; that seems to cure a wide variety of oddness. If that doesn't work, look for commonalities between quassel, wesnoth, and the other ports you've observed this failure with. For example, I see both quassel and wesnoth use cmake. Have you installed any of these ports' dependencies with nonstandard variants, like the +debug variant? If so, maybe that's contributing.

comment:4 Changed 16 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: wesnoth @1.16.6 +debug: linking error: udefined symbols for architecture x86_64wesnoth @1.16.6+debug: Undefined symbols _OBJC_CLASS_$_NSUserNotification, _OBJC_CLASS_$_NSUserNotificationCenter
Note: See TracTickets for help on using tickets.