Error Building binaries from source code with make command : "function does not return NSString" (Issue #23120)

610 views
Skip to first unread message

JAIMITKUMAR PANCHAL

unread,
Jan 6, 2023, 5:48:20 AM1/6/23
to wx-...@googlegroups.com, Subscribed

I am Facing NSBundle Error which says "function does not return NSString"

I am using cmake to build the binaries but couldn't figure out what went wrong while i try to run this command's, also i am new to this technology.

Command run successfully without any error.

cmake ..

The second command logs an error while building:

make -j 6

I also tried with flags and using a single thread.

make CXXFLAGS=-D"NS_FORMAT_ARGUMENT(A)="

Here is the Complete Log.

Consolidate compiler generated dependencies of target wxregex
[ 3%] Built target wxregex
Consolidate compiler generated dependencies of target wxjpeg
[ 8%] Built target wxjpeg
Consolidate compiler generated dependencies of target wxpng
[ 11%] Built target wxpng
Consolidate compiler generated dependencies of target wxtiff
[ 15%] Built target wxtiff
Consolidate compiler generated dependencies of target wxbase
[ 15%] Building OBJCXX object libs/base/CMakeFiles/wxbase.dir/////src/osx/cocoa/stdpaths.mm.o
In file included from /Users/jaimitkumarpanchal/Desktop/wxWidgets-3.2.1/src/osx/cocoa/stdpaths.mm:24:
In file included from /Users/jaimitkumarpanchal/Desktop/wxWidgets-3.2.1/include/wx/osx/private.h:4:
In file included from /Users/jaimitkumarpanchal/Desktop/wxWidgets-3.2.1/include/wx/osx/core/private.h:47:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:28:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIToolbox.h:240:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/IMKInputSession.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString

  • (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
    ~~~~~~~~~~~~~~ ^ ~
    /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
    #define NS_FORMAT_ARGUMENT(A) attribute ((format_arg(A)))
    ^ ~
    1 error generated.
    make[2]: *** [libs/base/CMakeFiles/wxbase.dir/////src/osx/cocoa/stdpaths.mm.o] Error 1
    make[1]: *** [libs/base/CMakeFiles/wxbase.dir/all] Error 2
    make: *** [all] Error 2

JAIMITKUMARs-MacBook-Air:macbuild jaimitkumarpanchal$ make CXXFLAGS=-D"NS_FORMAT_ARGUMENT(A)="
[ 3%] Built target wxregex
[ 8%] Built target wxjpeg
[ 11%] Built target wxpng
[ 15%] Built target wxtiff
Consolidate compiler generated dependencies of target wxbase
[ 15%] Building OBJCXX object libs/base/CMakeFiles/wxbase.dir/////src/osx/cocoa/stdpaths.mm.o
In file included from /Users/jaimitkumarpanchal/Desktop/wxWidgets-3.2.1/src/osx/cocoa/stdpaths.mm:24:
In file included from /Users/jaimitkumarpanchal/Desktop/wxWidgets-3.2.1/include/wx/osx/private.h:4:
In file included from /Users/jaimitkumarpanchal/Desktop/wxWidgets-3.2.1/include/wx/osx/core/private.h:47:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:28:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/HIToolbox.h:240:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/IMKInputSession.h:23:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString

  • (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
    ~~~~~~~~~~~~~~ ^ ~
    /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
    #define NS_FORMAT_ARGUMENT(A) attribute ((format_arg(A)))
    ^ ~
    1 error generated.
    make[2]: *** [libs/base/CMakeFiles/wxbase.dir/////src/osx/cocoa/stdpaths.mm.o] Error 1
    make[1]: *** [libs/base/CMakeFiles/wxbase.dir/all] Error 2
    make: *** [all] Error 2

Platform and version information

  • wxWidgets version 3.2.1
  • OS : MacOS BigSur 11.6.3
  • Compiler - clang and gcc
  • cmake version 3.24.2


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23120@github.com>

VZ

unread,
Jan 6, 2023, 8:58:11 AM1/6/23
to wx-...@googlegroups.com, Subscribed

Are you using clang or gcc? It might be simply impossible to build Cocoa programs with non-Apple-specific gcc versions, I'm not really sure as nobody does it any more AFAIK, but unless you have a specific reason to use gcc, you should use clang from the same SDK you have.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23120/1373677450@github.com>

JAIMITKUMAR PANCHAL

unread,
Jan 6, 2023, 10:43:02 AM1/6/23
to wx-...@googlegroups.com, Subscribed

@vadz
I have tried with both of them, I am guessing it might be due to CommandlineTool version.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23120/1373816164@github.com>

VZ

unread,
Jan 6, 2023, 11:29:17 AM1/6/23
to wx-...@googlegroups.com, Subscribed

The simplest and most foolproof way of making sure the build works on Mac is to uninstall the command line tools package and install the full Xcode. In particular, combining both of them often doesn't work (depending on the versions involved) IME.

I also don't think it's really a wxWidgets problem, so closing.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23120/1373866782@github.com>

VZ

unread,
Jan 6, 2023, 11:29:19 AM1/6/23
to wx-...@googlegroups.com, Subscribed

Closed #23120 as completed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/23120/issue_event/8170631216@github.com>

Reply all
Reply to author
Forward
0 new messages