This is the mail archive of the mailing list for the pthreas-win32 project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling pthreads under windows CE with eVC++

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.

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

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)

4.) change #include <errno.h> to
    #ifndef WINCE
    #include <errno.h>
    in the following files:

5.) Change #include <process.h> to
    #ifndef WINCE
    #include <process.h>
    in the following files:

6.) Change #include <sys/timeb.h> to
    #ifndef WINCE
    #include <sys/timeb.h>
    in the following files:

7.) Change #include <signal.h> to
    #ifndef WINCE
    #include <signal.h>
    in the following files:

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.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]