| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jul 21, 2010
Posts: 1
![]() |
Hi,
I am pretty new to XCode and Web Objects/ Objective C apps. I am trying to build an existing Obj C app on my local machine that runs OS X 10.6.2 and getting the below error: My XCode version is 3.2 and the cc used is gcc-4.0 regexp_stuff.m:1501:23: error: macro "strncpy" requires 3 arguments, but only 1 given regexp_stuff.m: In function ‘_MOregsub’: regexp_stuff.m:1501: error: ‘strncpy’ redeclared as different kind of symbol regexp_stuff.m:1501: warning: unused variable ‘strncpy’ Please let me know if you have any pointers on how to debug this issue. Thanks! |
| QUOTE Thanks | |
|
Member Since: Feb 25, 2009
Posts: 2,084
![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 Non-retina MBP, 2.6GHz i7, 8GB RAM, Antiglare Screen
|
It would really help to see your code - just seeing the error only gives part of the picture.
For example: " regexp_stuff.m:1501:23: error: macro "strncpy" requires 3 arguments, but only 1 given " would be given probably because there is a functioned defined as strncpy that is part of the strings library (in strings.h) and the prototype looks like: char *strncpy(char *s1, const char *s2, size_t n); so the compiler is wondering how come with a function that requires three parameters, you've only supplied 1. in this: regexp_stuff.m: In function ‘_MOregsub’: regexp_stuff.m:1501: error: ‘strncpy’ redeclared as different kind of symbol regexp_stuff.m:1501: warning: unused variable ‘strncpy’ In a function you have created, it appears you have defined strncpy as something else, which is giving the compiler a headache because it's already aware of a function called strncpy, you don't want local variables to have the same name as functions otherwise you run into ugly errors. The last one is potentially nothing important - it's just stating you declared a variable but didn't actually use it in the function. It's kind of like doing: int addInts(int a, int b) { int x; return a+b; } I declared x but didn't actually use it in the function - the compiler is letting you know that you have a variable in there that is either wasted space or you managed to forget to include it in what you were doing. My Macs: 2012 Non-Retina 15" MBP; Mac mini G4, 1.25 GHz, 512m ram (server); Late 2011 11" MBA, 1.8GHz i7, 4Gig Ram, 256Gig SSD, HD3000; Powerbook 12" G4 1.33GHz running Debian as a server; Apple TV (1080p version) |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Help!: Browser errors, cannot fix | MTEK | Apple Notebooks | 0 | 06-09-2010 10:53 PM |
| Do i need to do anything to repair/save my hard drive? | oxband | Apple Notebooks | 3 | 04-09-2009 11:04 AM |
| to build or not to build? that's the question. | james_falknor | Other Hardware and Peripherals | 1 | 02-23-2009 08:54 PM |
| Buy or Build a MacBook Pro? | sobershea | Apple Notebooks | 3 | 08-11-2008 12:53 PM |
| XCode build hangs? | robin | OS X - Development and Darwin | 3 | 01-12-2004 01:42 AM |
All times are GMT -4. The time now is 10:14 PM.
Powered by vBulletin