Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve MAC OS _XOPEN_SOURCE error in Xcode while compiling?

Tags:

iphone

I am developing application for .Epub extension file reader.I have source code available. But while compiling the code i am getting below error :

#error The deprecated ucontext routines require _XOPEN_SOURCE to be defined

I have gone through the internet for different kind of help, but not able to find exact solution.

Can anybody having any idea which kind of error it is?

How to resolve the above error in Xcode ?

please help out with any resolution for it.

Thanks.

like image 248
Developer Avatar asked Oct 16 '25 01:10

Developer


1 Answers

You need to add a pre-processor define to your build command line (-D_XOPEN_SOURCE=600 for instance). Do this through your IDE's project properties, or by editing your makefile/changing your compiler flag environment variables.

Alternatively, add:

#define _XOPEN_SOURCE 600

before anything includes standard headers in your code.

like image 150
Mat Avatar answered Oct 20 '25 00:10

Mat