Porting unmanaged c++ dll from VS Net 2003 to VS Net 2005 beta 2 Windows Mobile

Hi,
we are currently face with a big problem..
We have an application made in c# than run on windows xp an 2k using .net framework 1.1.
The solution is almost all in c# except 1 project that is in unmanaged c++.
Everything is working fine under Vs Net 2003.

We're trying to port this application to Windows Mobile 2003 and/or Windows Mobile 5 but we have some problem with the c++ project.

Theres some include files that cant be found witch are :

#include <fcntl.h>

#include <sys/types.h>

#include <errno.h>


i've grabbed thos files from visual studio 2005 vc include folder as they are not in the pocket pc sdk include folder and putted them in my src folder and included them with " "
This dont seem to cause any problem.
But here are the most anoying problem :
Error 8 error C4980: '__gc' : use of this keyword requires /clr:oldSyntax command line option c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ldpctest2\LdpcWrapper.h 24

Error 9 error C3630: error when processing the token '__gc' c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ldpctest2\LdpcWrapper.h 24

Error 10 fatal error C1190: managed targeted code requires a '/clr' option c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ldpctest2\LdpcWrapper.h 24

I vs net 2003 we needed the /clr switch
and from error 8 ('__gc' : use of this keyword requires /clr:oldSyntax command line option). i learned that i have to use the /clr:oldSyntax switch.
I tryied to find it in the project properting with no luck, so i added it manually in the c++ command line property but it makes an error :
Warning 1 Command line warning D9002 : ignoring unknown option '/clr:oldSyntax' cl

also tried with only /clr :
Warning 1 Command line warning D9002 : ignoring unknown option '/clr' cl
Here's our complete command line options list :
/Od /Os /D "_WIN32_WCE=0x501" /D "UNDER_CE=0x501" /D "WINCE" /D "WIN32_PLATFORM_PSPC" /D "_DEBUG" /D "DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LDPCTEST2_EXPORTS" /D "ARM" /D "_ARM_" /D "_UNICODE" /D "UNICODE" /D "_WINDLL" /Gm /EHsc /MTd /fp:fast /GR /Fo"Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Debug/" /Fd"Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Debug/vc80.pdb" /W3 /nologo /c /Zi /TP

Its seems to be a really simple problem but cant find the solution, please help!

Thanks a lot

[2878 byte] By [ElieRodrigue] at [2007-12-16]
# 1

So is anybody able to help me?
I just found out that in standart c++ app in vs net 2005 CLR support is in property->Configuration properties-> general
But this option is not in the smart devices project but the compiler error let us think that its supported...
Is clr support planned for smart devices project?
If yes, when will it be availible?

ElieRodrigue at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 2

I don't quite understand what you're trying to do. Managed C++ is not supported for devices and native C++ compiler does not support __gc keyword.

If it’s managed C++, you can’t do that, sorry. Your options are to use native C++ or port to C#.

If it’s native C++, please modify the source code so it’s compatible with native C++ compilers for Windows CE.

IlyaTumanov at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 3
Well, we got some managed c++ calling native c++ and we dont want to port the native c++ to c#.
Is managed c++ support planned in visual studio .net 2005 final?
ElieRodrigue at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 4

No, managed C++ is not going to be supported on NETCF V2.

Since we see very few requests for it, it's unlikely to be supported in future versions as well.


You can either port your managed C++ to native C++ or to C#.


For native C++, you can continue using it on devices, source tweaking might be necessary to port your code to Window CE.

IlyaTumanov at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 5
could i use com object to export native c++ class and use them in c#?
ElieRodrigue at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...
# 6

Yes, you can in NETCF V2.

IlyaTumanov at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices General...