You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by strana <st...@gmail.com> on 2007/12/14 23:30:43 UTC

Compiling Xerces under Windows Mobile

Hello,
has anyone tried to compile Xerces under Windows Mobile?

I tried to do so and I am struggling with lots of compile errors, most of
them caused probably by differences in header files for Win Mobile platform,
but there seem to be also other errors, more difficult to solve.

I found two older diffs here, which should make the source of a specific
revision compilable under Win Mobile, so I exported the revision from svn,
but when I tried to patch with the diff, about half of the 'hunks' failed.

If you have any idea or experience with compiling Xerces under Win Mobile, I
would appreciate your input. So far as I look on the compiler output, I
don't feel like I am able to put it into usable state myself :))

Regards,
Jiří Stránský
-- 
View this message in context: http://www.nabble.com/Compiling-Xerces-under-Windows-Mobile-tp14339833p14339833.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Compiling Xerces under Windows Mobile

Posted by strana <st...@gmail.com>.

zippy1981 wrote:
> 
> Jiří,
> 
> Weird. Are you sure that WIN32_WCE=$(CEVER)  in that particular
> project? also is that project targeted to windows ce and is CEVER
> getting defined somewhere? If you can capture the command line the IDE
> runs that generates that error and change the switches to just output
> the source file after the preprocessor is run you might get a better
> idea of what is going on.
> 
> If you can get that  output send it as a nabble attachment like those
> compiler errors and I'll take a look see.
> 
> regards,
> 
> Justin Dearing
> 

Hello Justin,
I examined the command lines and finally I have found out that the cause was
that I didn't know there are separate defines for source compiler and
resource compiler, oops... I'm not very used to Visual Studio yet.

Now I'm stuck at something what is probably very stupid, but I don't know
how to solve it.. There is this in Win32TransService.cpp:

const unsigned int nameBufSz = 1024;
#ifndef WINCE
	char nameBuf[nameBufSz + 1];
#else
	wchar_t nameBuf[nameBufSz + 1]; // <- here point the errors
#endif 

And it says that nameBufSz is undeclared...

http://www.nabble.com/file/p14427808/errors.txt errors.txt 

In the original Xerces there is this:
const unsigned int nameBufSz = 1024;
char nameBuf[nameBufSz + 1];

I don't see much difference in my code and the original... Actually, when I
commented out the ifdefs and kept only the two lines from the original, the
compiler still reported an error. I guess it has to be something very basic
again, but I don't see it... :/

Regards,
Jiří Stránský
-- 
View this message in context: http://www.nabble.com/Compiling-Xerces-under-Windows-Mobile-tp14339833p14427808.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Compiling Xerces under Windows Mobile

Posted by Justin Dearing <zi...@gmail.com>.
Jiří,

Weird. Are you sure that WIN32_WCE=$(CEVER)  in that particular
project? also is that project targeted to windows ce and is CEVER
getting defined somewhere? If you can capture the command line the IDE
runs that generates that error and change the switches to just output
the source file after the preprocessor is run you might get a better
idea of what is going on.

If you can get that  output send it as a nabble attachment like those
compiler errors and I'll take a look see.

regards,

Justin Dearing

On Dec 18, 2007 1:50 PM, strana <st...@gmail.com> wrote:
>
> Hello,
> today I've got to the state of _one_ compile error.
>
> I have
> Error   7       fatal error RC1015: cannot open include file 'winresrc.h'.
> C:\Program Files (x86)\Microsoft Visual Studio
> 8\VC\ce\atlmfc\include\winres.h 33
>
>
> It's strange, because when I open winres.h, there is this:
> #ifndef _WIN32_WCE
> #include <winresrc.h>
> #else // _WIN32_WCE
> #include <dlgs.h>
> #include <winbase.h>
> #include <commctrl.h>
> #include <resdefce.h>
> #endif // _WIN32_WCE
>
> And I have _WIN32_WCE=$(CEVER) defined in project defines, so I think it
> shouldn't search for winresrc.h at all...
>
> Do you have any idea why this happens?
>
> This header is being included in xercesc\util\MsgLoaders\Win32\Version.rc.
>
> Regards,
> Jiří Stránský
> --
> View this message in context: http://www.nabble.com/Compiling-Xerces-under-Windows-Mobile-tp14339833p14403311.html
>
> Sent from the Xerces - C - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
> For additional commands, e-mail: c-dev-help@xerces.apache.org
>
>

Re: Compiling Xerces under Windows Mobile

Posted by strana <st...@gmail.com>.
Hello,
today I've got to the state of _one_ compile error.

I have
Error	7	fatal error RC1015: cannot open include file 'winresrc.h'.
C:\Program Files (x86)\Microsoft Visual Studio
8\VC\ce\atlmfc\include\winres.h	33	


It's strange, because when I open winres.h, there is this:
#ifndef _WIN32_WCE
#include <winresrc.h>
#else // _WIN32_WCE
#include <dlgs.h>
#include <winbase.h>
#include <commctrl.h>
#include <resdefce.h>
#endif // _WIN32_WCE

And I have _WIN32_WCE=$(CEVER) defined in project defines, so I think it
shouldn't search for winresrc.h at all...

Do you have any idea why this happens?

This header is being included in xercesc\util\MsgLoaders\Win32\Version.rc.

Regards,
Jiří Stránský
-- 
View this message in context: http://www.nabble.com/Compiling-Xerces-under-Windows-Mobile-tp14339833p14403311.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Compiling Xerces under Windows Mobile

Posted by strana <st...@gmail.com>.
I did a lot of playing with project defines. Now the error count has dropped,
but it seems I have to compile the project with _UNICODE and UNICODE
defined, or I get errors like:

Error	1	error C2664: 'OutputDebugStringW' : cannot convert parameter 1 from
'const char [94]' to 'LPCWSTR'
c:\strana\circletech\xerces_working\src\xercesc\util\XMLString.hpp	1518	

It seems the problem is in assert macro, which calls the widechar version
even if UNICODE or _UNICODE is not defined, I guess it is a problem caused
by another of my defines... Right now they are:

_DEBUG
_WIN32_WCE=$(CEVER)
UNDER_CE
$(PLATFORMDEFINES)
$(ARCHFAM)
$(_ARCHFAM_)
WINCE
DEBUG
UNICODE
_UNICODE
_WINDOWS
POCKETPC2003_UI_MODEL
XERCES_BUILDING_LIBRARY
XERCES_USE_TRANSCODER_WINDOWS
XERCES_USE_WIN32_MSGLOADER
XERCES_USE_NETACCESSOR_WINSOCK
XERCES_USE_FILEMGR_WINDOWS
XERCES_USE_MUTEXMGR_WINDOWS
XERCES_USE_ATOMICOPMGR_WINDOWS
XERCES_PATH_DELIMITER_BACKSLASH
XERCES_NO_ASM

Also, I added regular Viusual C++ include dir to include path, because
otherwise there would be no "errno.h" file, which is missing in Win Mobile
SDK. I hope it is going to link all right after compilation. If not, I will
remove this include dir and solve it somehow else.

So when I compile with unicode support the error count has dropped to 20,
here is the current list:  http://www.nabble.com/file/p14354930/errors.txt
errors.txt 

Unfortunately, I have to stop working on this for a few days, because I have
two exams at the university on Monday evening and I have to learn much :) I
will continue on Tuesday.

Thanks a lot for your help so far, Justin.

Regards,
Jiří Stránský
-- 
View this message in context: http://www.nabble.com/Compiling-Xerces-under-Windows-Mobile-tp14339833p14354930.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Compiling Xerces under Windows Mobile

Posted by Justin Dearing <zi...@gmail.com>.
Hi JS,


On Dec 15, 2007 7:36 AM, strana <st...@gmail.com> wrote:
>
>
> zippy1981 wrote:
> >
> > Can you provide those compile errors. Also what compiler? Embedded VC++
> > 4.0?

> I assume I could get rid of some other errors (those reported in header
> files) by typedefs again, but there's probably a reason why they are not in
> Win Mobile headers and I wonder if it will work correctly when I finally
> compile it...
> http://www.nabble.com/file/p14350401/errors.txt errors.txt

Ok this will take some work but I think its possible to do this
elegantly enough with some #ifdef's with some effort.  Let me help you
with some of the low hanging fruit.

Error	1	error C3861: 'stricmp': identifier not
found	c:\strana\circletech\xerces\src\xercesc\util\XMLString.cpp	235
Error	2	error C3861: 'strnicmp': identifier not
found	c:\strana\circletech\xerces\src\xercesc\util\XMLString.cpp	258
Error	3	error C3861: 'strnicmp': identifier not
found	c:\strana\circletech\xerces\src\xercesc\util\XMLString.cpp	530

It seems that what you need here is the following:
#ifdef _WIN32_WCE
#	define stricmp _stricmp
#	define strnicmp _strnicmp
#elseif !HAVE_STRICMP
#	include <lib/stricmp.h>
#endif
#if !HAVE_STRNICMP
#	include <lib/strnicmp.h>
#endif

Now lets move onto
Error	69	error C4235: nonstandard extension used : '__asm' keyword not
supported on this
architecture	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	704
Error	70	error C2065: 'mov' : undeclared
identifier	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	706
Error	71	error C2146: syntax error : missing ';' before identifier
'eax'	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	706
Error	72	error C2065: 'eax' : undeclared
identifier	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	706
Error	73	error C2146: syntax error : missing ';' before identifier
'ebx'	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	707
Error	74	error C2065: 'ebx' : undeclared
identifier	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	707
Error	75	error C2146: syntax error : missing ';' before identifier
'ecx'	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	708
Error	76	error C2065: 'ecx' : undeclared
identifier	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	708
Error	77	error C2146: syntax error : missing ';' before identifier
'lock'	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	709
Error	78	error C2065: 'lock' : undeclared
identifier	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	709
Error	79	error C2146: syntax error : missing ';' before identifier
'cmpxchg'	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	709
Error	80	error C2065: 'cmpxchg' : undeclared
identifier	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp	709
Error	81	error C2146: syntax error : missing ';' before identifier
'result'	c:\strana\circletech\xerces\src\xercesc\util\Platforms\Win32\Win32PlatformUtils.cpp

Since you are not on x86 inline assembly won't work. one line will fix this:
-#if (defined(_MSC_VER) || defined(__BCPLUSPLUS__)) && !defined(XERCES_NO_ASM)
+#if (defined(_MSC_VER) || defined(__BCPLUSPLUS__)) &&
!defined(_WIN32_WCE) && !defined(XERCES_NO_ASM)

Now the rest of the header issues are probably related to a #define
you must undefine in the project. However, this should fix a chunk of
your errors. Can you give that a try and send the output again?

Regards,

Justin Dearing

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Compiling Xerces under Windows Mobile

Posted by strana <st...@gmail.com>.

zippy1981 wrote:
> 
> Can you provide those compile errors. Also what compiler? Embedded VC++
> 4.0?
> 
I compiled it in MS Visual Studio 2005 with Windows Mobile 5.0 SDK. I'm
attaching list of errors. There has been a few hundreds of them, but I was
able to get rid of most of them by changing includes and a few typedefs.
I assume I could get rid of some other errors (those reported in header
files) by typedefs again, but there's probably a reason why they are not in
Win Mobile headers and I wonder if it will work correctly when I finally
compile it...
http://www.nabble.com/file/p14350401/errors.txt errors.txt 

zippy1981 wrote:
> 
> Can you please link to these patches. Also, have you tried  manyally
> applying any of these hunks?
> 
The patches are  http://issues.apache.org/jira/browse/XERCESC-1609 here .
They are for revision 417945, but as I said, they fail. I didn't try
applying them manually because there's quite a lot of them and I was hoping
for more elegant solution..

Regards,
JS
-- 
View this message in context: http://www.nabble.com/Compiling-Xerces-under-Windows-Mobile-tp14339833p14350401.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Compiling Xerces under Windows Mobile

Posted by Justin Dearing <zi...@gmail.com>.
Hello Jiří,

On Dec 14, 2007 5:30 PM, strana <st...@gmail.com> wrote:
>
> Hello,
> has anyone tried to compile Xerces under Windows Mobile?

I've not tried it but I've done some mobile development so I wouldn't
mind if it existed.

> I tried to do so and I am struggling with lots of compile errors, most of
> them caused probably by differences in header files for Win Mobile platform,
> but there seem to be also other errors, more difficult to solve.

Can you provide those compile errors. Also what compiler? Embedded VC++ 4.0?

> I found two older diffs here, which should make the source of a specific
> revision compilable under Win Mobile, so I exported the revision from svn,
> but when I tried to patch with the diff, about half of the 'hunks' failed.

Can you please link to these patches. Also, have you tried  manyally
applying any of these hunks?


Regards,

Justin Dearing