PDA

View Full Version : latest svn update errors in iOS



osgoz
04-04-2012, 09:06 AM
Hi.

Latest svn update introduces errors in function GetMacAddress() in iOSUtils.mm
Exactly the errors are:
if ((mgmtInfoBase[5] = if_nametoindex("en0")) == 0) --> Use of undeclared if_nametoindex
socketStruct = (struct sockaddr_dl *) (interfaceMsgStruct + 1); --> Arithmetic on a pointer to an incomplete type
memcpy(&macAddress, socketStruct->sdl_data + socketStruct->sdl_nlen, 6); --> Member access into incomplete type

Only if you does not noticed it yet.

Regards.

Seth
04-04-2012, 01:19 PM
Hmm, strange, I am not getting those errors. Can you make sure you have these includes near the top of iOSUtils.mm?


#include <netinet/in.h>
#include <net/if.h>
#include <net/if_dl.h>


I am using Xcode 4.2, what are you using?

osgoz
04-04-2012, 02:43 PM
I am using Xcode 4.3.2

The top of my iOSUtils.mm


#include "iOSUtils.h"
#import <UIKit/UIKit.h>
#import <cstdarg>
#include <string>
#include <sys/time.h>
#include <sys/sysctl.h>
#include "BaseApp.h"
#include <SystemConfiguration/SystemConfiguration.h>
#include "Network/NetUtils.h"
#import <MobileCoreServices/MobileCoreServices.h>
#import <MyAppDelegate.h>
#import <EAGLView.h>

using namespace std;

void LogMsg(const char *lpFormat, ...)
...


I just copy those includes to the iOSUtils.mm file and compiled fine.

Thanks

Seth
04-04-2012, 09:55 PM
Hmm, those lines are definitely in the latest svn version.. not sure why it isn't getting picked up by your svn update.

You can see the svn version here (http://rtsoft.com/svn/filedetails.php?repname=Proton&path=%2Fshared%2FiOS%2FiOSUtils.mm).

osgoz
04-09-2012, 08:49 AM
Hi.

Sorry for late reply.
I have just made a svn update and get rev. 876.
I am using MacOS X 10.7.3 Lion with svn version 1.6.17 that is preinstaled with the system.
I don't understand why doesn't get the iOSUtils.mm correctly.
Anyway, it's working right now, so don't worry :cool:

Regards.