- Remove From My Forums
-
Question
-
I am trying to convert a native c++ application into c++/cli. Now I get this error. The solution seems simple: just change the command-line options.
The strange thing, however, is that this option (Enable C++ exceptions) is not set to /EHs, but to /EHa. I have tried every option (even /EHs) but I keep getting this error.
Even stranger, in another build configuration (Release build), I have the same combination of command-line options (/clr and /EHa), and this compiles just fine.
I tried rebuilding the project and closing and opening Visual Studio, but that doesn’t help either.
Any help is appreciated.
Answers
-
The strange thing, however, is that this option (Enable C++ exceptions) is not set to /EHs, but to /EHa. I have tried every option (even /EHs) but I keep getting this error.
Even stranger, in another build configuration (Release build), I have the same combination of command-line options (/clr and /EHa), and this compiles just fine.The compiler settings can be overridden per-file — check the settings
for the individual source file (rather than the project) selected in
Solution Explorer.Dave
-
Marked as answer by
Monday, July 2, 2012 10:37 AM
-
Marked as answer by
Permalink
Cannot retrieve contributors at this time
description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid |
---|---|---|---|---|---|
Learn more about: Command-Line Error D8016 |
Command-Line Error D8016 |
11/04/2016 |
D8016 |
D8016 |
eec51312-7471-4f92-94b2-d517cafc8ef5 |
‘option1’ and ‘option2’ command-line options are incompatible
The command-line options cannot be specified together.
Check environment variables, such as CL, for option specifications.
/clr implies /EHa, and you cannot specify any other /EH compiler option with /clr. For more information, see /clr (Common Language Runtime Compilation).
You may get D8016 after updating a Visual C++ 6.0 project: the project update wizard process may enable /RTC for each source code file in the project, which overrides the /RTC setting for the project. To resolve, change the /RTC setting for each source code file in the project to the default setting, which means the project setting for /RTC will be in effect for each file.
See /RTC (Run-Time Error Checks) for information on changing the /RTC property setting.
Содержание
- Command line error d8016 ehs and clr
- Answered by:
- Question
- Answers
- All replies
- Command line error d8016 ehs and clr
- Answered by:
- Question
- Answers
- All replies
- Greg Dolley’s Weblog
- A Blog about Graphics Programming, Game Programming, Tips and Tricks
- Archives
- Blog Stats
- Subscribers
- Subscribe
- Categories
- Blogroll
- How to Fix Visual Studio Bug: «’/RTC1′ and ‘/clr’ Options are Incompatible»
- Command line error d8016 ehs and clr
- Answered by:
- Question
- Answers
- All replies
Command line error d8016 ehs and clr
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
I am trying to convert a native c++ application into c++/cli. Now I get this error. The solution seems simple: just change the command-line options.
The strange thing, however, is that this option (Enable C++ exceptions) is not set to /EHs, but to /EHa. I have tried every option (even /EHs) but I keep getting this error.
Even stranger, in another build configuration (Release build), I have the same combination of command-line options (/clr and /EHa), and this compiles just fine.
I tried rebuilding the project and closing and opening Visual Studio, but that doesn’t help either.
Any help is appreciated.
Answers
The strange thing, however, is that this option (Enable C++ exceptions) is not set to /EHs, but to /EHa. I have tried every option (even /EHs) but I keep getting this error.
Even stranger, in another build configuration (Release build), I have the same combination of command-line options (/clr and /EHa), and this compiles just fine.
The compiler settings can be overridden per-file — check the settings
for the individual source file (rather than the project) selected in
Solution Explorer.
The strange thing, however, is that this option (Enable C++ exceptions) is not set to /EHs, but to /EHa. I have tried every option (even /EHs) but I keep getting this error.
Even stranger, in another build configuration (Release build), I have the same combination of command-line options (/clr and /EHa), and this compiles just fine.
The compiler settings can be overridden per-file — check the settings
for the individual source file (rather than the project) selected in
Solution Explorer.
Shortly after posting this question, I discovered that C++/CLI projects do not (yet) support Intellisense. I then decided not to convert my entire application to C++/CLI but instead build a small ‘wrapper project’ using C++/CLI to call some .Net components from my application. So my original problem disappeared.
I did however confirm that some files in the application have different compiler settings, so this would in all likelihood have solved the problem and I marked David’s reply as answer.
Also, these inconsistent compiler settings are unintentional so it is a good thing that I am now aware of them. Fixing this will problaby save me a lot of time sooner or later. So thanks a lot.
For those who run into the same problem and need to check the settings of all files in their project, there is an easy way to do this. You can rightclick your project in Visual Studio en then unload and edit your project. Then you can search the project file for the ExceptionHandling element.
Источник
Command line error d8016 ehs and clr
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
i made up a small aplication but during compliation i ended up having comaand line errors,
after resolving few of thoese errors, through form help, i am stuck again,
this error D8016 after i resolved error C1190 managed targeted code requires ‘/clr’ option
but the problem now is the this error , Command line error D8016 : ‘/MT’ and ‘/clr’ command-line options are incompatible cl
some one please help me out in this, Thankyou
Answers
Hi,
the /clr option isn’t compatible with the /MT (multi threaded). Check this page to see the restrictions when using the /clr:
http://msdn2.microsoft.com/en-us/library/ffkc918h.aspx
To solve the problem, go to your project properties->C/C++->Code Generation->Runtime Library->Multi-threaded Debug DLL (/MDd)
(or Multi-threaded DLL (/MD) for release configuration)
Try doing what the compiler says, adding the #define _AFXDLL or you can use the preprocessor options in project properties->c/c++->preprocessor->preprocessor definitions
add a ; if you need to separate from another definition and add _AFXDLL
As for your other question about the terms:
— CRT — C Run-Time libraries, the libraries that contain the information about the C standard functions
— DLL — Dynamic Linked Library is a library that instead of being «merged» with the executable like a static library (.lib files), it stays in a separate file that is loaded when needed by your application.
— AFXDLL — This is shared version of the MFC libraries.
This kind of terms/acronyms can be found easily in google/wikipedia and other resources if you don’t want to wait for a response here 😉
Hope this helps with your problems.
Hi,
the /clr option isn’t compatible with the /MT (multi threaded). Check this page to see the restrictions when using the /clr:
http://msdn2.microsoft.com/en-us/library/ffkc918h.aspx
To solve the problem, go to your project properties->C/C++->Code Generation->Runtime Library->Multi-threaded Debug DLL (/MDd)
(or Multi-threaded DLL (/MD) for release configuration)
Thanks for the help , but it seems these erros wont go away, ,i did as u u told me to do , i changed the settign , and made it Multithreaded Debug DLL
but now there is another Error .Error 1 fatal error C1189: #error : Building MFC application with /MD (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD C:Program FilesMicrosoft Visual Studio 8VCatlmfcincludeafx.h 24
And one more thing, would be a gr8 help As u must have realsied that im really very new to it , and i really dont get wht all these Terms mean .
Afx DLL and Crt . ,/Md . DLLm,CRT As these werent explain in the book which im using to learn «Sams TeachYourself VisualC++.net . So kindly cud u explain me a bit about these so dat i can know whts going on, , as it s no use to do wht other tell u to do, unless u ur self dont know wht u doing is for wht?
Try doing what the compiler says, adding the #define _AFXDLL or you can use the preprocessor options in project properties->c/c++->preprocessor->preprocessor definitions
add a ; if you need to separate from another definition and add _AFXDLL
As for your other question about the terms:
— CRT — C Run-Time libraries, the libraries that contain the information about the C standard functions
— DLL — Dynamic Linked Library is a library that instead of being «merged» with the executable like a static library (.lib files), it stays in a separate file that is loaded when needed by your application.
— AFXDLL — This is shared version of the MFC libraries.
This kind of terms/acronyms can be found easily in google/wikipedia and other resources if you don’t want to wait for a response here 😉
Hope this helps with your problems.
hey thanks , i will try them out tommoro as me off at the moment but as far as i remember i did the chnage the preprocessor defination before nas well , like it but i will go through it again,,
and yes ur rite but on google u dont really good teachers, but yea to save time ur right,
but i really need a guideline form start , who can tell how to go thorugh as i have changed my strategy and now rather then useing Sams teach ur self book , im refering to msdn library to learn VC, but i need ur or any other person ehlp who can help step by step to learn it, as i have chosed to start programming after long time, and i have forgotten many things but a easyguide can refreash my mind , and i can b back on track , and i have learned VC is very diffcult to grab,& handle . so i dont know but as my manger has given me limited time to get hang of this Vc.
but in ny case Thanks and if tommoro i get anbother i will post back again 😉 LOL.
Источник
Greg Dolley’s Weblog
A Blog about Graphics Programming, Game Programming, Tips and Tricks
Archives
December 2007
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Blog Stats
Subscribers
- I was looking for an email client recently and discovered Mailbird. I must say I’m super impressed! Not only is it… twitter.com/i/web/status/1…3 days ago
- RT @TechAmazing: The algorithm behind Tik Tok. https://t.co/Zk07bsjzSQ2 months ago
- @engineers_feed 8? (4×4(area of outer square)=16-2(area of each triangle)x4=16-8=8) 4 months ago
- Cool trick I found to solve this shrine in under a minute. You can just skip to the exit! #zelda… twitter.com/i/web/status/1…2 years ago
- This guy thought he had me. Until he got shot in the head MID-FLINCH! 😆 #callofduty#callofdutysniping#cod… twitter.com/i/web/status/1…2 years ago
Subscribe
Categories
Blogroll
How to Fix Visual Studio Bug: «’/RTC1′ and ‘/clr’ Options are Incompatible»
Posted by gregd1024 on December 31, 2007
Have you ever received this error when converting a native C++ project to MC++?
1>cl : Command line error D8016 : ‘/RTC1’ and ‘/clr’ command-line options are incompatible
While, yes, it’s true that ‘/RTC1’ (basic runtime checking) with ‘/clr’ (.NET support) are incompatible options, the problem is there’s no place in the Visual Studio IDE to turn off ‘/RTC1’ once it’s set (not even from the command line editor). The Project Settings dialog just lists different modes of runtime checking without a “disable” option:
In order to fix this problem, follow these steps:
- Open up your “vcproj” file in a regular text editor.
- Search for all the strings that look like:
- Replace all instances with this string:
In your project file the “BasicRuntimeChecks” variable may not necessarily equal “3.” It just happened to be the default in my project. Whatever number appears as your default just replace it with “0” and that should fix the problem.
Источник
Command line error d8016 ehs and clr
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
i made up a small aplication but during compliation i ended up having comaand line errors,
after resolving few of thoese errors, through form help, i am stuck again,
this error D8016 after i resolved error C1190 managed targeted code requires ‘/clr’ option
but the problem now is the this error , Command line error D8016 : ‘/MT’ and ‘/clr’ command-line options are incompatible cl
some one please help me out in this, Thankyou
Answers
Hi,
the /clr option isn’t compatible with the /MT (multi threaded). Check this page to see the restrictions when using the /clr:
http://msdn2.microsoft.com/en-us/library/ffkc918h.aspx
To solve the problem, go to your project properties->C/C++->Code Generation->Runtime Library->Multi-threaded Debug DLL (/MDd)
(or Multi-threaded DLL (/MD) for release configuration)
Try doing what the compiler says, adding the #define _AFXDLL or you can use the preprocessor options in project properties->c/c++->preprocessor->preprocessor definitions
add a ; if you need to separate from another definition and add _AFXDLL
As for your other question about the terms:
— CRT — C Run-Time libraries, the libraries that contain the information about the C standard functions
— DLL — Dynamic Linked Library is a library that instead of being «merged» with the executable like a static library (.lib files), it stays in a separate file that is loaded when needed by your application.
— AFXDLL — This is shared version of the MFC libraries.
This kind of terms/acronyms can be found easily in google/wikipedia and other resources if you don’t want to wait for a response here 😉
Hope this helps with your problems.
Hi,
the /clr option isn’t compatible with the /MT (multi threaded). Check this page to see the restrictions when using the /clr:
http://msdn2.microsoft.com/en-us/library/ffkc918h.aspx
To solve the problem, go to your project properties->C/C++->Code Generation->Runtime Library->Multi-threaded Debug DLL (/MDd)
(or Multi-threaded DLL (/MD) for release configuration)
Thanks for the help , but it seems these erros wont go away, ,i did as u u told me to do , i changed the settign , and made it Multithreaded Debug DLL
but now there is another Error .Error 1 fatal error C1189: #error : Building MFC application with /MD (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD C:Program FilesMicrosoft Visual Studio 8VCatlmfcincludeafx.h 24
And one more thing, would be a gr8 help As u must have realsied that im really very new to it , and i really dont get wht all these Terms mean .
Afx DLL and Crt . ,/Md . DLLm,CRT As these werent explain in the book which im using to learn «Sams TeachYourself VisualC++.net . So kindly cud u explain me a bit about these so dat i can know whts going on, , as it s no use to do wht other tell u to do, unless u ur self dont know wht u doing is for wht?
Try doing what the compiler says, adding the #define _AFXDLL or you can use the preprocessor options in project properties->c/c++->preprocessor->preprocessor definitions
add a ; if you need to separate from another definition and add _AFXDLL
As for your other question about the terms:
— CRT — C Run-Time libraries, the libraries that contain the information about the C standard functions
— DLL — Dynamic Linked Library is a library that instead of being «merged» with the executable like a static library (.lib files), it stays in a separate file that is loaded when needed by your application.
— AFXDLL — This is shared version of the MFC libraries.
This kind of terms/acronyms can be found easily in google/wikipedia and other resources if you don’t want to wait for a response here 😉
Hope this helps with your problems.
hey thanks , i will try them out tommoro as me off at the moment but as far as i remember i did the chnage the preprocessor defination before nas well , like it but i will go through it again,,
and yes ur rite but on google u dont really good teachers, but yea to save time ur right,
but i really need a guideline form start , who can tell how to go thorugh as i have changed my strategy and now rather then useing Sams teach ur self book , im refering to msdn library to learn VC, but i need ur or any other person ehlp who can help step by step to learn it, as i have chosed to start programming after long time, and i have forgotten many things but a easyguide can refreash my mind , and i can b back on track , and i have learned VC is very diffcult to grab,& handle . so i dont know but as my manger has given me limited time to get hang of this Vc.
but in ny case Thanks and if tommoro i get anbother i will post back again 😉 LOL.
Источник
Hi all ,
I want to acess the C#.net class in my C++ project.
To do this I changed the project property settings as
project property settings->gernaral->common language runtime support to common language support (clr)
After setting this property I am getting following error :
Error 2 Command line error D8016 : /clr and &/EHs command-line options are incompatible cl
Can anybody help me?
Thanks in advance……
Regards,
RJ
Updated 23-Feb-21 19:17pm
Solution 2
From MSDN: /clr implies /EHa, and you cannot specify any other /EH compiler option with /clr.
So try to change this option in your project properties: under C/C++, Code Generation, change «Enable C++ Exceptions» to the appropriate value.
If it still doesn’t work, consider creating a fresh new C++/CLI project and add you existing source files to this new project.
Comments
Thanks for the reply….
What is the appropriate value???
I tried with all the three option under that.
But it is not working.
So go to step 2: If it still doesn’t work, consider creating a fresh new C++/CLI project and add you existing source files to this new project.
Changing the options on existing projects is often messy, I suggest you to start over with a new project and add your existing .h and .cpp files.
Solution 1
Comments
Thanks for the reply….
The link you provided is irrelevant.
I am getting the following error in my program:
error D8016: '/ZI' and '/clr' command-line options are incompatible
This happens when I put the following lines and enable common runtime in configuration->General (If I dont enable it then the error will come at using system and System::Drawing )
#using <system.drawing.dll>
using namespace System;
using namespace System::Drawing;
Actually I will be using some windows library in my code that requires the above dll.
How to solve this issue?
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/imgproc/imgproc_c.h>
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <ctype.h>
#using <system.drawing.dll>
using namespace System;
using namespace System::Drawing;
using namespace std;
int main( int argc, char** argv )
{
IplImage *source = cvLoadImage( "Image.bmp");
// Here we retrieve a percentage value to a integer
int percent =20;
// declare a destination IplImage object with correct size, depth and channels
IplImage *destination = cvCreateImage
( cvSize((int)((source->width*percent)/100) , (int)((source->height*percent)/100) ),
source->depth, source->nChannels );
//use cvResize to resize source to a destination image
cvResize(source, destination);
// save image with a name supplied with a second argument
cvShowImage("new:",destination);
cvWaitKey(0);
return 0;
}
Posted by gregd1024 on December 31, 2007
Have you ever received this error when converting a native C++ project to MC++?
1>cl : Command line error D8016 : ‘/RTC1’ and ‘/clr’ command-line options are incompatible
While, yes, it’s true that ‘/RTC1’ (basic runtime checking) with ‘/clr’ (.NET support) are incompatible options, the problem is there’s no place in the Visual Studio IDE to turn off ‘/RTC1’ once it’s set (not even from the command line editor). The Project Settings dialog just lists different modes of runtime checking without a “disable” option:
In order to fix this problem, follow these steps:
- Open up your “vcproj” file in a regular text editor.
- Search for all the strings that look like:
BasicRuntimeChecks=”3″
- Replace all instances with this string:
BasicRuntimeChecks=”0″
In your project file the “BasicRuntimeChecks” variable may not necessarily equal “3.” It just happened to be the default in my project. Whatever number appears as your default just replace it with “0” and that should fix the problem.
-Greg Dolley
Subscribe via RSS here. Want email updates instead? Click here.
This entry was posted on December 31, 2007 at 12:47 pm and is filed under General Programming, Tips and Tricks.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.