public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: "Philip Cuadra" <pcuadra@andrew.cmu.edu>
To: pthreads-win32@sources.redhat.com
Subject: Re: Compiling pthreads under windows CE with eVC++
Date: Tue, 08 Jun 2004 22:38:00 -0000	[thread overview]
Message-ID: <1260.128.2.186.98.1086734327.squirrel@webmail.andrew.cmu.edu> (raw)
In-Reply-To: <40ADBE88.5030805@callisto.canberra.edu.au>

Hey again Ross,
Other things have kept me from getting back to this for a while.  But I've
been banging at it for little bit, and am now hitting a strange link error
that isn't quite making sense to me.

Linking...
Creating library ARMV4Rel/pthreadsdll.lib and object ARMV4Rel/pthreadsdll.exp
pthread.obj : error LNK2019: unresolved external symbol errno referenced
in function ptw32_semwait
ARMV4Rel/pthreadsdll.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Here's the entire procedure I've been following so far.  I am attempting
to compile pthreads to a DLL for a Win32 (WCE ARMV4 Release), Pocket PC
2003 Device in Microsoft Embedded Visual C++ 4.0.

1.) Define WINCE and HAVE_CONFIG_H in the project settings

2.) In implement.h, add this around line #50
    *
    * Taken from Visual Studio 7 to provide PAPCFUNC definition
    * PAC 5-21-04
    */
    #ifdef WINCE
    typedef VOID (APIENTRY *PAPCFUNC)( ULONG_PTR dwParam);
    #endif

3.) In pthread_cancel.c, add this around line #60
    /*
     *  Added to allow compilation for ARM processors
     *  PAC 5-21-04
     */
    #if defined(_ARM_)
    #define PTW32_PROGCTR(Context)  ((Context).Psr)
    #endif

4.) change #include <errno.h> to
    #ifndef WINCE
    #include <errno.h>
    #endif
    in the following files:
    pthread_rwlock_destroy.c(38)
    pthread_rwlock_init.c(38)
    pthread_rwlock_rdlock.c(38)
    pthread_rwlock_timedrdlock.c(38)
    pthread_rwlock_timedwrlock.c(38)
    pthread_rwlock_tryrdlock.c(38)
    pthread_rwlock_trywrlock.c(38)
    pthread_rwlock_unlock.c(38)
    pthread_rwlock_wrlock.c(38)
    pthread_rwlockattr_destroy.c(38)
    pthread_rwlockattr_getpshared.c(38)
    pthread_rwlockattr_init.c(38)
    pthread_rwlockattr_setpshared.c(38)

5.) Change #include <process.h> to
    #ifndef WINCE
    #include <process.h>
    #endif
    in the following files:
    create.c(43)
    exit.c(42)
    implement.h(601)
    mutex.c(39)

6.) Change #include <sys/timeb.h> to
    #ifndef WINCE
    #include <sys/timeb.h>
    #endif
    in the following files:
    mutex.c(43)
    pthread_mutex_timedlock.c(42)
    sem_timedwait.c(49)
    semaphore.c(50)

7.) Change #include <signal.h> to
    #ifndef WINCE
    #include <signal.h>
    #endif
    in the following files:
    pthread_detach.c(46)
    pthread_join.c(46)
    pthread_kill.c(45)

8.) In pthread.h, around line 257, change
    #include <sched.h>  to
    #include "sched.h"

When I try to build from this point, the linker error occurs.  I'm not
sure why it would be having this problem, but it thinks it needs errno.
If you have any ideas, they would be greatly appreciated.

Thanks,
Philip Cuadra



> These build environments apparently don't define PAPCFUNC, so it will
> need to be defined for WINCE by implement.h. I don't recall the exact
> details and I'm away from my machine, but for MSVC you can find it in
> Windef.h I think. E.g. in implement.h after:-
>
> #include <windows.h>
>
> add this:-
>
> #ifndef PAPCFUNC
> # define PAPCFUNC (void (*)(DWORD))
> // Or whatever it is in windef.h
> #endif
>
> Ross
>
> Philip Cuadra wrote:
>
>>Hi folks,
>>I'm trying to build the .dll for pthreads under MS eVC++ 4.0 for Windows
>>CE 4 (Pocket PC 2003) on an ARM processor (the IPAQ 5555).  As I am new
>> to
>>both CE and eVC++, I am having troubles with this.  I have tried
>> following
>>the instructions in the readmes to no avail.  I have defined WINCE when I
>>compile.  I am using the pthread-2004-05-16-fixed self-extracting file to
>>get teh source files.
>>
>>When I try to compile, I first get this error:
>>pthread.h(256): Could not find the file sched.h.
>>I can fix this by changing line 256 in pthread.h from
>>#include <sched.h>
>>to
>>#include "sched.h"
>>
>>After changing that, I instead get the following errors:
>>implement.h(506) : error C2146: syntax error : missing ')' before
>>identifier 'callback'
>>implement.h(506) : error C2061: syntax error : identifier 'callback'
>>implement.h(506) : error C2059: syntax error : ';'
>>implement.h(506) : error C2059: syntax error : ','
>>implement.h(507) : error C2059: syntax error : ')'
>>implement.h(588) : fatal error C1083: Cannot open include file:
>>'process.h': No such file or directory
>>Error executing clarm.exe.
>>ptw32_threadStart.c(87): Could not find the file exceptio.h.
>>ptw32_threadStart.c(87): Could not find the file exceptio.h.
>>ptw32_threadStart.c(87): Could not find the file exceptio.h.
>>
>>I believe I am missing something due to my lack of experience with MS
>> eVC++
>>and WinCE.  Any help would eb greatly appreciated, as we're in the
>> process
>>of porting our project to many different systems and Pthreads looks like
>>the best way to go.
>>
>>Thanks in advance,
>>Philip
>>
>>
>>
>
>
>
>

      parent reply	other threads:[~2004-06-08 22:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 21:53 Philip Cuadra
2004-05-21 10:36 ` James Ewing
2004-05-22  1:12   ` Ross Johnson
     [not found] ` <40ADBE88.5030805@callisto.canberra.edu.au>
2004-06-08 22:38   ` Philip Cuadra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1260.128.2.186.98.1086734327.squirrel@webmail.andrew.cmu.edu \
    --to=pcuadra@andrew.cmu.edu \
    --cc=pthreads-win32@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).