managed extensions

  • Thread starter Thread starter Bonj
  • Start date Start date
B

Bonj

I'm having a problem compiling a managed extensions project that has one set
of functions that is supposed to be unmanaged.
I've found out how to set the properties of a single file, in which way I
can set the /clr option on a file level, which is good.
But when I add the unmanaged code as a .c file, I get
Words fatal error C1190: managed targeted code requires '#using
<mscorlib.dll>' and '/clr' option
only if the /clr option for the file is set to true.
But if I add them as a .cpp file, I get that same error if the /clr option
is set to false.

Could I not add them as a .cpp file with /clr off?


Also I get the linker warning
nochkclr.obj : warning LNK4099: PDB 'libc.pdb' was not found with
'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\nochkclr.obj' or
at '...\libc.pdb'; linking object as if no debug info

What's the resolution for this?
 
Thanks very much
This doesn't solve the issue I describe, but I think it probably bypasses it.

I'm still curious as to why .c files can be compiled with the 'Assembly
support (/clr)' switch off, whereas C++ files can't. Perhaps it just *wants*
you to write managed code.
 
Bonj said:
I'm having a problem compiling a managed extensions project that has one set
of functions that is supposed to be unmanaged.
I've found out how to set the properties of a single file, in which way I
can set the /clr option on a file level, which is good.
But when I add the unmanaged code as a .c file, I get
Words fatal error C1190: managed targeted code requires '#using
<mscorlib.dll>' and '/clr' option
only if the /clr option for the file is set to true.
But if I add them as a .cpp file, I get that same error if the /clr option
is set to false.

Could I not add them as a .cpp file with /clr off?

You can use /clr option only with cpp files (or files compiled with
/Tp). You may also look at #pragma managed and #pragma unmanaged

Arnaud
MVP - VC
 
Back
Top