libs-base
libs-base copied to clipboard
Build failure on Mac OS 10.15.7 use of undeclared identifier in unicode
Hello,
I'm attempting to compile libs-base on Mac OS 10.15.7. I'm running into a few compiler errors, I was wondering if anyone knew how I can address them.
![image](https://user-images.githubusercontent.com/7237725/183739156-36cbbfc5-54e7-4e2f-acc1-527f74aae8cd.png)
NSURL+GNUstepBase.m:163:10: warning: incompatible pointer types returning 'CFStringRef' (aka 'const struct __CFString *') from a function with result type 'NSString *'
[-Wincompatible-pointer-types]
return CFURLCopyPath(self);
^~~~~~~~~~~~~~~~~~~
6 warnings generated.
Unicode.m:226:4: error: use of undeclared identifier 'NSISOCyrillicStringEncoding'; did you mean 'NSDOSCyrillicStringEncoding'?
{NSISOCyrillicStringEncoding,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSCyrillicStringEncoding
./GNUstepBase/Unicode.h:157:3: note: 'NSDOSCyrillicStringEncoding' declared here
NSDOSCyrillicStringEncoding = 0x80000413, /* code page 855, IBM Cyrillic */
^
Unicode.m:234:4: error: use of undeclared identifier 'NSISOArabicStringEncoding'; did you mean 'NSDOSArabicStringEncoding'?
{NSISOArabicStringEncoding,
^~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSArabicStringEncoding
./GNUstepBase/Unicode.h:163:3: note: 'NSDOSArabicStringEncoding' declared here
NSDOSArabicStringEncoding = 0x80000419, /* code page 864 */
^
Unicode.m:236:4: error: use of undeclared identifier 'NSISOGreekStringEncoding'; did you mean 'NSDOSGreekStringEncoding'?
{NSISOGreekStringEncoding,
^~~~~~~~~~~~~~~~~~~~~~~~
NSDOSGreekStringEncoding
./GNUstepBase/Unicode.h:152:3: note: 'NSDOSGreekStringEncoding' declared here
NSDOSGreekStringEncoding = 0x80000405, /* code page 737 (formerly code page 437G) */
^
Unicode.m:238:4: error: use of undeclared identifier 'NSISOHebrewStringEncoding'; did you mean 'NSDOSHebrewStringEncoding'?
{NSISOHebrewStringEncoding,
^~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSHebrewStringEncoding
./GNUstepBase/Unicode.h:161:3: note: 'NSDOSHebrewStringEncoding' declared here
NSDOSHebrewStringEncoding = 0x80000417, /* code page 862 */
^
Unicode.m:244:4: error: use of undeclared identifier 'NSISOThaiStringEncoding'; did you mean 'NSDOSThaiStringEncoding'?
{NSISOThaiStringEncoding,
^~~~~~~~~~~~~~~~~~~~~~~
NSDOSThaiStringEncoding
./GNUstepBase/Unicode.h:167:3: note: 'NSDOSThaiStringEncoding' declared here
NSDOSThaiStringEncoding = 0x8000041D, /* code page 874, also for Windows */
^
Unicode.m:579:59: warning: 'lossyCString' is deprecated: first deprecated in macOS 10.4 - Use -cStringUsingEncoding: instead [-Wdeprecated-declarations]
&& strcmp(str_encoding_table[count].ename, [encodstr lossyCString]))
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:502:1: note: 'lossyCString'
has been explicitly marked deprecated here
- (nullable const char *)lossyCString NS_RETURNS_INNER_POINTER API_DEPRECATED("Use -cStringUsingEncoding: instead", macos(10.0,10.4), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
^
Unicode.m:1400:12: error: use of undeclared identifier 'NSISOCyrillicStringEncoding'; did you mean 'NSDOSCyrillicStringEncoding'?
case NSISOCyrillicStringEncoding:
^~~~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSCyrillicStringEncoding
./GNUstepBase/Unicode.h:157:3: note: 'NSDOSCyrillicStringEncoding' declared here
NSDOSCyrillicStringEncoding = 0x80000413, /* code page 855, IBM Cyrillic */
^
Unicode.m:1415:12: error: use of undeclared identifier 'NSISOThaiStringEncoding'; did you mean 'NSDOSThaiStringEncoding'?
case NSISOThaiStringEncoding:
^~~~~~~~~~~~~~~~~~~~~~~
NSDOSThaiStringEncoding
./GNUstepBase/Unicode.h:167:3: note: 'NSDOSThaiStringEncoding' declared here
NSDOSThaiStringEncoding = 0x8000041D, /* code page 874, also for Windows */
^
Unicode.m:1540:60: warning: values of type 'NSStringEncoding' should not be used as format arguments; add an explicit cast to 'unsigned long' instead [-Wformat]
NSLog(@"GSToUnicode() No iconv for encoding x%02x", enc);
~~~~ ^~~
%02lx (unsigned long)
Unicode.m:2422:12: error: use of undeclared identifier 'NSISOCyrillicStringEncoding'; did you mean 'NSDOSCyrillicStringEncoding'?
case NSISOCyrillicStringEncoding:
^~~~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSCyrillicStringEncoding
./GNUstepBase/Unicode.h:157:3: note: 'NSDOSCyrillicStringEncoding' declared here
NSDOSCyrillicStringEncoding = 0x80000413, /* code page 855, IBM Cyrillic */
^
Unicode.m:2440:12: error: use of undeclared identifier 'NSISOThaiStringEncoding'; did you mean 'NSDOSThaiStringEncoding'?
case NSISOThaiStringEncoding:
^~~~~~~~~~~~~~~~~~~~~~~
NSDOSThaiStringEncoding
./GNUstepBase/Unicode.h:167:3: note: 'NSDOSThaiStringEncoding' declared here
NSDOSThaiStringEncoding = 0x8000041D, /* code page 874, also for Windows */
^
Unicode.m:2574:62: warning: values of type 'NSStringEncoding' should not be used as format arguments; add an explicit cast to 'unsigned long' instead [-Wformat]
NSLog(@"GSFromUnicode() No iconv for encoding x%02x", enc);
~~~~ ^~~
%02lx (unsigned long)
Unicode.m:2840:15: error: use of undeclared identifier 'NSISOCyrillicStringEncoding'; did you mean 'NSDOSCyrillicStringEncoding'?
enc = NSISOCyrillicStringEncoding;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSCyrillicStringEncoding
./GNUstepBase/Unicode.h:157:3: note: 'NSDOSCyrillicStringEncoding' declared here
NSDOSCyrillicStringEncoding = 0x80000413, /* code page 855, IBM Cyrillic */
^
Unicode.m:2853:15: error: use of undeclared identifier 'NSISOArabicStringEncoding'; did you mean 'NSDOSArabicStringEncoding'?
enc = NSISOArabicStringEncoding;
^~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSArabicStringEncoding
./GNUstepBase/Unicode.h:163:3: note: 'NSDOSArabicStringEncoding' declared here
NSDOSArabicStringEncoding = 0x80000419, /* code page 864 */
^
Unicode.m:2857:15: error: use of undeclared identifier 'NSISOGreekStringEncoding'; did you mean 'NSDOSGreekStringEncoding'?
enc = NSISOGreekStringEncoding;
^~~~~~~~~~~~~~~~~~~~~~~~
NSDOSGreekStringEncoding
./GNUstepBase/Unicode.h:152:3: note: 'NSDOSGreekStringEncoding' declared here
NSDOSGreekStringEncoding = 0x80000405, /* code page 737 (formerly code page 437G) */
^
Unicode.m:2861:15: error: use of undeclared identifier 'NSISOHebrewStringEncoding'; did you mean 'NSDOSHebrewStringEncoding'?
enc = NSISOHebrewStringEncoding;
^~~~~~~~~~~~~~~~~~~~~~~~~
NSDOSHebrewStringEncoding
./GNUstepBase/Unicode.h:161:3: note: 'NSDOSHebrewStringEncoding' declared here
NSDOSHebrewStringEncoding = 0x80000417, /* code page 862 */
^
Unicode.m:2873:15: error: use of undeclared identifier 'NSISOThaiStringEncoding'; did you mean 'NSDOSThaiStringEncoding'?
enc = NSISOThaiStringEncoding;
^~~~~~~~~~~~~~~~~~~~~~~
NSDOSThaiStringEncoding
./GNUstepBase/Unicode.h:167:3: note: 'NSDOSThaiStringEncoding' declared here
NSDOSThaiStringEncoding = 0x8000041D, /* code page 874, also for Windows */
^
3 warnings and 14 errors generated.
gnumake[4]: *** [obj/Additions.obj/Unicode.m.o] Error 1
gnumake[3]: *** [internal-subproject-all_] Error 2
gnumake[2]: *** [Additions.all.subproject.variables] Error 2
gnumake[1]: *** [internal-all] Error 2
make: *** [internal-all] Error 2
So you are building GNUstep additions only? It seems like a few NSStringEncoding enums are not defined in Apple's Foundation. Some time ago we had a change that added a few more enums to GNUstep.
Thanks for your reply.
I would like to compile the whole thing actually but I thought I would start with the base. I got the same errors running the ./tools-scripts/clang-build
script. Is there a way to get it to fully compile on MacOS?
I adjusted the values in Headers/GNUstep/Unicode.h to include the missing encoding constants. Please give it a try.
@rfm I think you might have mistakenly pushed this on the wrong branch (libcurl-autoconf).
On 25 Aug 2022, at 09:40, Frederik Seiffert @.***> wrote:
@rfm I think you might have mistakenly pushed this on the wrong branch (libcurl-autoconf).
Thanks ... I accidentally made two commits on the wrong branch, and have now reverted them.
After putting my commits in the master branch where they should have been to start with, I was able to build on OSX.