Need help porting Linux code to Symbian
| Mon, 2007-10-15 20:31 | |
|
Hi guys, I have been trying to port Linux code to Symbian platform: Firstly i foun dthe following errors: for which Than I got the following errors: ..\..\..\..\9.1\S60_3rd_MR_2\EPOC32\include\stdapis\sys\_timeval.h undefined identifier '__suseconds_t' I have been stuck in this for long time and really need some help. Cheers, |
|






Forum posts: 982
Can you show the code?
pirosl
Forum posts: 25
TimerThreadWorker( void *arg )
{
TimerThread *timer = ( TimerThread * ) arg;
ListNode *head = NULL;
TimerEvent *nextEvent = NULL;
time_t currentTime = 0;
time_t nextEventTime = 0;
struct timespec timeToWait;
even this gives me the same error
timeToWait.tv_nsec = 0;
timeToWait.tv_sec = nextEvent->eventTime;ithread_cond_timedwait( &timer->condition, &timer->mutex,
&timeToWait );
all the thing inside code gives me
error
Forum posts: 25
Timespec.h is defined as
#include <sys/_types.h>
#include <sys/cdefs.h>
#ifndef _SYS_TIMESPEC_H_
#define _SYS_TIMESPEC_H_
#if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
#define SYMBIAN
#endif
#ifndef _TIME_T_DECLARED
typedef _time_t time_t;
#define _TIME_T_DECLARED
#endif
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
#if __BSD_VISIBLE
#define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
} while (0)
#endif /* __BSD_VISIBLE */
#endif /* _SYS_TIMESPEC_H_ */
and _types.h
as
#ifndef _SYS__TYPES_H
#define _SYS__TYPES_H
typedef int _time_t;
typedef long _off_t;
typedef long _ssize_t;
#endif /* _SYS__TYPES_H */
Forum posts: 982
>>> even this gives me the same error
>>> timeToWait.tv_nsec = 0;
Are you sure you don't have timespec in more than one header file?
pirosl
Forum posts: 25
OOPs sorry.ya me too getting there error as well.Print mistake.Have any clues???stuck up there hmm and deadling for my project fast approaching.hmmm....
Forum posts: 25
Ya have checked it cant find it else were
Forum posts: 25
Hmm .. got rid of all the errors except this one:
ithread_cond_timedwait( &timer->condition, &timer->mutex,
&timeToWait );
error is as follows:
illegal implicit conversion from 'const struct timespec *' to 'const struct timespec *'
Forum posts: 982
At this point you do:
const struct timespec blablaToWait = &timeToWait;
ithread_cond_timedwait( &timer->condition, &timer->mutex, blablaToWait );
and everything should be fine
pirosl
Forum posts: 982
Sorry forgot the start in previous post:
so
const struct timespec* blablaToWait = &timeToWait;
pirosl
Forum posts: 25
Hi,
Those errors went off,but getting few new ones:
getting this errors now:
..\..\..\..\9.1\S60_3rd_MR_2\EPOC32\include\libc\netinet\ip_icmp.h undefined identifier 'n_time'
..\..\..\..\9.1\S60_3rd_MR_2\EPOC32\include\libc\netinet\ip_icmp.h undefined identifier 'n_short'
Forum posts: 982
You miss net_type.h
pirosl
Forum posts: 25
Cant find that header??????????
Forum posts: 25
*** No rule to make target `\Symbian\9.1\S60_3rd_MR_3\EPOC32\RELEASE\WINSCW\UDEB\libcrt0.lib', needed by `\Symbian\9.1\S60_3rd_MR_3\EPOC32\RELEASE\WINSCW\UDEB\u.exe'. error is coming
Forum posts: 982
can you show the mmp file?
pirosl
Forum posts: 25
SYSTEMINCLUDE \epoc32\include\stdapis // Open C
SYSTEMINCLUDE \epoc32\include
SYSTEMINCLUDE \epoc32\include\libc
//..
LIBRARY libc.lib // Open C
LIBRARY libcrt0.lib
LIBRARY estlib.lib // Symbian libc