public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Compiling pthreads under windows CE with eVC++
@ 2004-05-20 21:53 Philip Cuadra
  2004-05-21 10:36 ` James Ewing
       [not found] ` <40ADBE88.5030805@callisto.canberra.edu.au>
  0 siblings, 2 replies; 4+ messages in thread
From: Philip Cuadra @ 2004-05-20 21:53 UTC (permalink / raw)
  To: pthreads-win32

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling pthreads under windows CE with eVC++
  2004-05-20 21:53 Compiling pthreads under windows CE with eVC++ Philip Cuadra
@ 2004-05-21 10:36 ` James Ewing
  2004-05-22  1:12   ` Ross Johnson
       [not found] ` <40ADBE88.5030805@callisto.canberra.edu.au>
  1 sibling, 1 reply; 4+ messages in thread
From: James Ewing @ 2004-05-21 10:36 UTC (permalink / raw)
  To: pthreads-win32

Phillip Cuadra wrote -

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

This thread may help in getting WINCE pthreads to compile -

http://sources.redhat.com/ml/pthreads-win32/2003/msg00101.html

James Ewing

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling pthreads under windows CE with eVC++
  2004-05-21 10:36 ` James Ewing
@ 2004-05-22  1:12   ` Ross Johnson
  0 siblings, 0 replies; 4+ messages in thread
From: Ross Johnson @ 2004-05-22  1:12 UTC (permalink / raw)
  To: pthreads-win32

I look's like PAPCFUNC isn't defined via windows.h for the WinCE 
cross-compilers. Either that or defining _WIN32_WINNT to 0x400 doesn't 
make sense for WinCE.

Anyway, my suggestion to Phillip was to look in MSVC's windef.h (I don't 
have it at hand) and copy the definition into implement.h.

E.g. implement.h should look something like this if I recall correctly:-

#include <windows.h>

#ifndef PAPCFUNC
# define PAPCFUNC (void CALLBACK (*)(DWORD))
#endif

And then hopefully CALLBACK is defined.

If this doesn't work then someone please let me know because I'll need 
to re-arrange the code for WinCE.

Does WinCE support APC? Pthreads-win32 is assuming it does (by expecting 
these macros to be defined) even if it doesn't get used.

Cheers.
Ross

James Ewing wrote:

>Phillip Cuadra wrote -
>
>"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).  "
>-------------
>
>This thread may help in getting WINCE pthreads to compile -
>
>http://sources.redhat.com/ml/pthreads-win32/2003/msg00101.html
>
>James Ewing
>
>  
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compiling pthreads under windows CE with eVC++
       [not found] ` <40ADBE88.5030805@callisto.canberra.edu.au>
@ 2004-06-08 22:38   ` Philip Cuadra
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Cuadra @ 2004-06-08 22:38 UTC (permalink / raw)
  To: pthreads-win32

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-08 22:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-20 21:53 Compiling pthreads under windows CE with eVC++ 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 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).