discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to enable regexp im getting :error: use of undeclared identifier


From: David Chisnall
Subject: Re: how to enable regexp im getting :error: use of undeclared identifier 'NSRegularExpression'; did you mean 'NSRegularExpressionSearch
Date: Wed, 16 Jan 2013 10:46:18 +0000

Hi,

Your first problem is that, for some reason (probably my fault) Foundation.h 
does not include NSRegularExpression.h.  You can fix this by adding this to 
your program as a temporary work-around:

#import <Foundation/NSRegularExpression.h>

If ICU is detected by the configure script, it will be used automatically.  If 
not, then you may need to specify it exactly.

Note that for NSRegularExpression to work exactly as documented by Apple, it 
MUST be compiled with blocks support.  Make sure that you are using libobjc2 
and have -fobjc-nonfragile-abi in your OBJCFLAGS.

David


On 16 Jan 2013, at 10:31, umen wrote:

> hello i want to run simple regexp with objective-c 
> as this example : 
> 
> https://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSRegularExpression_Class/Reference/Reference.html
> <https://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSRegularExpression_Class/Reference/Reference.html>
>   
> 
> but when i compile the file with: $ make CC=clang
> im getting :
> HtmlParser.m:21:2: error: use of undeclared identifier
> 'NSRegularExpression'; did you mean 'NSRegularExpressionSearch'?
>        NSRegularExpression *regex = [NSRegularExpression
> regularExpressionWithPattern:@"href=[\\'\\"]?([^\\'\\" >]+)"
>        ^~~~~~~~~~~~~~~~~~~
>        NSRegularExpressionSearch
> C:/GNUstep/GNUstep/System/Library/Headers\Foundation/NSString.h:122:2: note:
> 'NSRegularExpressionSearch' declared here
> NSRegularExpressionSearch = 1024
> ^
> 
> 
> with this code:
> NSError *error = NULL;
>       NSRegularExpression *regex = [NSRegularExpression
> regularExpressionWithPattern:@"href=[\\'\\"]?([^\\'\\" >]+)"
> 
> options:NSRegularExpressionCaseInsensitive
> 
> error:&error];
> 
> 
> when i try to find the method in the Foundation headers i do see it 
> 
> // GNUstep, like OS X, uses libicu to provide the NSRegularExpression
> // implementation.  If you have configured GNUstep without this support then
> it
> // will not work, so these methods are hidden.
> #if GS_USE_ICU || GS_UNSAFE_REGEX
> + (NSRegularExpression*)regularExpressionWithPattern: (NSString*)aPattern
>                                             options:
> (NSRegularExpressionOptions)opts
>                                               error: (NSError**)e; 
> 
> 
> how do i enable using libicu ( i have the libicu dll's )
> 
> 
> 
> --
> View this message in context: 
> http://gnustep.8.n7.nabble.com/how-to-enable-regexp-im-getting-error-use-of-undeclared-identifier-NSRegularExpression-did-you-mean-h-tp32400.html
> Sent from the GNUstep - General mailing list archive at Nabble.com.
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep

-- Send from my Jacquard Loom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]