Compiling error C1190 while building solution for Visual C++.net project  
Author Message
kunallen





PostPosted: Smart Devices Native C++ Development, Compiling error C1190 while building solution for Visual C++.net project Top

Hi, all,

I am using Visual studio 2005 to make a Visual c++ project. I was trying to make a simple UDP socket and threading program. The device manager i am using is wm 5.0 for Smartphone, and wm 5.0 Smartphone emulator. Here is what I have in the header file:

#using <mscorlib.dll>

using namespace System;

using namespace System::Threading;

using namespace System::Data;

using namespace System::Net;

using namespace System::Net::Socket;

When I was trying to compile it, an error message popped up:"fatal error C1190: managed targeted code requires a 'clr' option", and I was trying to find this "clr" options in the project->properties->general-> right panel, but there is no such option. :-(

Can anyone help me with this problem Or for the compact framework 2.1 sp, it doesn't support the CLR

Thank you very much for any response! I'd really appreciate it!

Kun




Smart Device Development6  
 
 
cgraus





PostPosted: Smart Devices Native C++ Development, Compiling error C1190 while building solution for Visual C++.net project Top

/clr is the compiler option you need. I must be going blind but I can't see it there, either. Perhaps the easiest way is to just create a new, managed project.

New/Project/Visual C++/CLR



 
 
kunallen





PostPosted: Smart Devices Native C++ Development, Compiling error C1190 while building solution for Visual C++.net project Top

Thank you for your prompt reply. Yea... actually, if we change the platform to Win32, then everything is resloved.

But the point is, is it possible to use this 'clr' option under the windows Mobile 5.0 smartphone/pocket pc platform so that the using namespace can be considered legelly

Many thanks!

Kun


 
 
Mario Chenier - Microsoft





PostPosted: Smart Devices Native C++ Development, Compiling error C1190 while building solution for Visual C++.net project Top

/clr isn't supported when targetting windows mobile. Unhappily Managed C++ isn't supported by .NetCF at this time.

You'll either need to write the code in C#/VB for managed, or C/C++ Native.



 
 
syj





PostPosted: Smart Devices Native C++ Development, Compiling error C1190 while building solution for Visual C++.net project Top

Excuse me. What is Managed Project.

I met the same problem.

I am trying to complile a sample program download from the a web site. The sample program consists of a .cpp file, a .mak file, a .def file and several .chh, .h files.

I tried first using its .bat file to compile it. It should generated a .dll file. But I met many errors because the required .h files can't be opened. And then I searched and located all the required .h file, and modified all the relevant file using absolute path of the required .h Header files. Later, I got this error:

NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
cl -Zi -Od -DDEBUG -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=
1 -DWIN32 -D_WIN32 -W3 -D_WINNT -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DWINV
ER=0x0500 -Zpl /DMIDAS_ISV /DR50 /DR60 /DMIDAS_ISV_IMPORT -Ow -DNT -MLd N2HTML
.cpp
N2HTML.cpp
e:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\VCWizards\MC++WebService\
Templates\1033\stdafx.h(4) : fatal error C1190: managed targeted code requires '
#using <mscorlib.dll>' and '/clr' option

And then, I created a new project in Visual Studiao .NET 2003, as New/Project/Visual C++ Projects/Win32/Win32 Project, and I selected DLL and Empty Project in the wizard. And then I imported all the files I download of this program, and compiled. I got the error:

e:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\VCWizards\MC++WebService\Templates\1033\stdafx.h(4): fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option

I don't know how to created an Unmanaged proect

What should I do next



 
 
Ilya Tumanov





PostPosted: Smart Devices Native C++ Development, Compiling error C1190 while building solution for Visual C++.net project Top

Since managed C++ project type is not supported for devices, your project is already "unmanaged" (or native). That means you can not use any managed constructs in your source code. In this case the sample you’ve got designed with C++/CLI, so it’s not going to work on device unless completely rewritten. Please consider getting sample in supported language: C#, VB.Net or native C/C++.