Need help porting Linux code to Symbian

Login to reply to this topic.
Mon, 2007-10-15 20:31
Joined: 2007-10-09
Forum posts: 25

Hi guys,

I have been trying to port Linux code to Symbian platform:

Firstly i foun dthe following errors:
1)malloc.h and timeb.h files missing

for which
I replaced timeb.h with _timeval.h(found in epoc32\include\stdlib) and timeb structure with timeval structure in the code.

Than I got the following errors:

..\..\..\..\9.1\S60_3rd_MR_2\EPOC32\include\stdapis\sys\_timeval.h undefined identifier '__suseconds_t'
..\..\..\..\9.1\S60_3rd_MR_2\EPOC32\include\stdapis\sys\_timeval.h undefined identifier '__time_t'
..\..\..\..\9.1\S60_3rd_MR_2\EPOC32\include\stdapis\sys\_timeval.h undefined identifier 'suseconds_t'
illegal implicit conversion from 'struct timespec *' to 'const struct timespec *'
where this timespec struc can be found in timespec.h

I have been stuck in this for long time and really need some help.

Cheers,
Sam


Tue, 2007-10-16 10:27
Joined: 2004-05-24
Forum posts: 982
Re: Need help porting Linux code to Symbian

Can you show the code?


pirosl

Tue, 2007-10-16 10:43
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

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

Tue, 2007-10-16 10:44
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

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 */

Tue, 2007-10-16 13:20
Joined: 2004-05-24
Forum posts: 982
Re: Need help porting Linux code to Symbian

>>> 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

Tue, 2007-10-16 15:27
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

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....

Tue, 2007-10-16 15:28
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

Ya have checked it cant find it else were

Tue, 2007-10-16 15:32
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

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 *'

Tue, 2007-10-16 16:31
Joined: 2004-05-24
Forum posts: 982
Re: Need help porting Linux code to Symbian

At this point you do:
const struct timespec blablaToWait = &timeToWait;
ithread_cond_timedwait( &timer->condition, &timer->mutex, blablaToWait );

and everything should be fine


pirosl

Tue, 2007-10-16 16:32
Joined: 2004-05-24
Forum posts: 982
Re: Need help porting Linux code to Symbian

Sorry forgot the start in previous post:
so
const struct timespec* blablaToWait = &timeToWait;


pirosl

Tue, 2007-10-16 20:04
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

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'

Wed, 2007-10-17 10:31
Joined: 2004-05-24
Forum posts: 982
Re: Need help porting Linux code to Symbian

You miss net_type.h


pirosl

Wed, 2007-10-17 12:06
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

Cant find that header??????????

Wed, 2007-10-17 20:53
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

*** 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

Thu, 2007-10-18 11:09
Joined: 2004-05-24
Forum posts: 982
Re: Need help porting Linux code to Symbian

can you show the mmp file?


pirosl

Thu, 2007-10-18 11:12
Joined: 2007-10-09
Forum posts: 25
Re: Need help porting Linux code to Symbian

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

  • Login to reply to this topic.