Re: Importing a type library into unmanaged code with /clr switch - linker errors
- From: Duncan Smith <DSmith1974@xxxxxxxxxxxxxx>
- Date: 28 Apr 2007 08:16:26 -0700
Hi,
The best practise with /clr is to only define it for individual files. No
for whole projects. This can lead to a multitude of problems.
You also should not use #pragma unmanaged. source files should be wholly
compiled either managed or unmanaged, but not mixed. Doing so can lead to
CRT initialization problems.
Kind regards,
Bruno van Dooren MVP - VC++
http://msmvps.com/blogs/vanDooren
bruno_nos_pam_van_doo...@xxxxxxxxxxx
Thanks,
I made some progress by just enabling /clr on the module (cpp file)
only, but when I add managed code into the header file like:
#include <afxwinforms.h>
using namespace System;
using namespace System::Windows::Forms;
I get the compiler error:
3>C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include
\afxwinforms.h(19) : fatal error C1189: #error : MFC WinForms support
requires /clr (doesn't support oldSyntax)
How do I enable /clr for the header as well as the cpp without
applying it to the whole project?
Many thanks,
Duncan
.
- Follow-Ups:
- References:
- Importing a type library into unmanaged code with /clr switch - linker errors
- From: Duncan Smith
- Re: Importing a type library into unmanaged code with /clr switch - linker errors
- From: Bruno van Dooren
- Importing a type library into unmanaged code with /clr switch - linker errors
- Prev by Date: Re: Thread deadlock inside CString::AllocBuffer and sudden crashes
- Next by Date: Re: left handed use of conditional
- Previous by thread: Re: Importing a type library into unmanaged code with /clr switch - linker errors
- Next by thread: Re: Importing a type library into unmanaged code with /clr switch - linker errors
- Index(es):
Relevant Pages
|