Opened 11 years ago

Last modified 11 years ago

#5197 closed defect

Build for iOS (device) fails due to no crt_extern — at Version 2

Reported by: nsands Owned by: warmerdam
Priority: normal Milestone: 1.10.2
Component: ConfigBuild Version: 1.10.0
Severity: normal Keywords: ios
Cc: ilucena

Description (last modified by Even Rouault)

Building GDAL 1.10 for iOS (device) fails due to no crt_extern on iOS. Note that it builds OK for the iOS simulator, but not for the device. The build error is included below, but the following fixed this error. In file 'cpl_spawn.cpp' Replace:

#ifdef __APPLE__
#include <crt_externs.h>

With:

#ifdef __APPLE__
# include <TargetConditionals.h>
#endif
#if defined(__APPLE__) && !defined(TARGET_OS_IPHONE)
#include <crt_externs.h>

For completeness, the error output before this change was:

libtool: compile: 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Dev
eloper/usr/bin/g++ -arch armv7 -pipe -Os -gdwarf-2 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Dev
eloper/SDKs/iPhoneOS6.1.sdk -mno-thumb -mthumb-interwork -Wall
-DOGR_ENABLED -I/Users/nsands/Documents/Nik/Development/gdal-1.10.0/port
-DHAVE_LIBZ -I/usr/include/libxml2 -DHAVE_LIBXML2 -c cpl_spawn.cpp -o
cpl_spawn.o cpl_spawn.cpp:465:25: error: crt_externs.h: No such file or
directory cpl_spawn.cpp: In function 'CPLSpawnedProcess* CPLSpawnAsync(int
(*)(CPL_FILE_HANDLE, CPL_FILE_HANDLE), const char* const*, int, int, int,
char**)': cpl_spawn.cpp:727: error: '_NSGetEnviron' was not declared in
this scope make[1]: *** [cpl_spawn.lo] Error 1
make: *** [port-target] Error 2

Change History (2)

comment:1 by Even Rouault, 11 years ago

Description: modified (diff)

comment:2 by Even Rouault, 11 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.