Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual c++ problem with command line conflicts

Posted on 2015-02-04
22
Medium Priority
?
240 Views
Last Modified: 2015-03-07
I am using Visual c++ 2013 community to write an MFC dialog based program.  I am at the point where I am introducing an MS common dialog for user support.  Now, it will not build, telling me that I need /clr support.
If I add /clr it complains that /clr and /MTd command line options are incompatible.  I am WAY beyond my expertise level when dealing with command line options.
0
Comment
Question by:Dave Shields
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 4
  • +2
22 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 1000 total points
ID: 40588998
>>I am at the point where I am introducing an MS common dialog for user support.
You have added a .net based component (according to the clr requirement in the error message).  Remove that component and use one that is not .net based.

You can run MFC and .net together but it is rather complex.
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 1000 total points
ID: 40589033
It seems that yourt dialog is .NET - so, first of all, do you actually want to integrate managed components into your C++ project? If so, you indeed need to use '/clr'. Maybe start out with https://msdn.microsoft.com/en-us/library/vstudio/ms173265%28v=vs.120%29.aspx ("How To: Migrate to /clr") and https://msdn.microsoft.com/en-us/subscriptions/administration/06s5xsah%28v=vs.90%29.aspx ("ScribbleDotNET Sample: Extending Scribble with CLR Features") which shows how to to include new .NET functionality in your project.

And, to the '/MTd and /clr options are incompatible' thing - can your try and build your application with shared MFC libraries (or '/MDd')? Go to your Project Properties (ALT+F7), select "Configuration Properties|C/C++|Code Generation" and change "Runtime Library" to "Multithreaded Debug DLL" - "DLL" is the important part here.
0
 
LVL 15

Expert Comment

by:Karrtik Iyer
ID: 40591026
Is it possible for your to attach your test program that you are trying to build and run using MS VS 2013?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 35

Expert Comment

by:sarabande
ID: 40591514
>>Remove that component and use one that is not .net based.

which common dialog did you use? it is a good chance that mfc also provides a similar dialog.

Sara
0
 
LVL 35

Expert Comment

by:sarabande
ID: 40639850
actually the answer was given by Andy and not by me. therefore he should get the points.

Sara
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40639854
Thanks sara
0
 

Author Comment

by:Dave Shields
ID: 40642992
I've answered this problem myself, by disregarding instructions that I had been following in a book from 2002.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40643012
What did you do to solve it.
0
 

Author Comment

by:Dave Shields
ID: 40647234
Look, this was so hectic, trying to get an answer under a deadline, I honestly believe I solved this myself.  I do recall that I did pay attention to sara's comments, and did intereract with her so it would be appropriate if you awarded the points to her.
0
 
LVL 35

Expert Comment

by:sarabande
ID: 40647296
Dave, thanks. I appreciate your comment.

Eenookami, in my comment I referred to an answer given by Andy and asked for more information which was not given for the reasons Dave has elaborated.

since I added only minimal value to the answer - if at all - I recommend to close the question by accepting Andy's comment http://www.experts-exchange.com/Programming/Misc/Q_28610058.html#a40588998.

Sara
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40647420
>>I do recall that I did pay attention to sara's comments, and did intereract with her so it would be appropriate if you awarded the points to her.

That sort of implies you ignored anyone else, including the first comment instructing you not to use that new component you added and use a different one instead.
0
 

Author Comment

by:Dave Shields
ID: 40648053
Andy
Can you refresh my memory on the comment that you made, as I do not remember any of your comments being on point.
Dave
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40648073
? Just look - it is the very first comment in response to your question.
0
 

Author Comment

by:Dave Shields
ID: 40649334
Andy are referring to this comment
"You can run MFC and .net together but it is rather complex. "
That is probably true, but as I have stated, the crux to the solution was to abandon the book I was following, and I picked up on Sara's questions about classes, I had been adding a class to the project, which was necessary in VS2003, but was completely causing a stumbling in VS2013.  

Your comment that MFC and .net can run together was of NO help to me.  It is very generous of Sara to defer the points to you, but I don't find that fair.  Sara and I had a fairly long conversation over several days.  She gave me code to get over the first hurdle, and her questions actually led me to find the answer, by looking closely at the classes in 2003 vs 2013.  

I don't remember all the details, but I do feel that Sara's correspondence was always on point.  Truthfull I didn't understand many other posts.

Dave
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40649366
>>Andy are referring to this comment
Actually no, that is a part of the comment.

As you seem to have real troubles with your browser I'll copy and paste the rest and more relevant part - because that is the bit Sara referred to - of it here.

You have added a .net based component (according to the clr requirement in the error message).  Remove that component and use one that is not .net based.

That seems to be precisely what you 'discovered yourself' some days later.


>>Sara and I had a fairly long conversation over several days.

Four experts made one comment each, then you closed the question without making any intermediate comment yourself.  My understanding of conversation apparently differs from yours,


>> Truthfull I didn't understand many other posts.

OK, so jkr and myself were talking in too advanced a way - if that happens just ask nicely to dumb down our level to something you can cope with.  Ignoring means you just ignore top quality advice.
0
 

Author Comment

by:Dave Shields
ID: 40649508
Actually by this point I was out of the woods thanks to Sara.  What I wanted to do was activate a Browse button on the dialog, by calling up a common file dialog.   I eventually found a code example online which worked smoothly.  It adds a great deal to my program.  I could NOT in my opinion do without this   A Browse button saves a lot of typing and typos.  Evntually I resorted to searching on line for the error codes associated with this addition.  As i recall, I had to make changes to 5 different items before the code would compile.

So, you see I could not take your advice even if I understood it, as the Browse feature was an essential design choice.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40649557
deja vu:

 Remove that component and use one that is not .net based.
0
 

Author Comment

by:Dave Shields
ID: 40649859
Remove that component and use one that is not .net based.????????????
I originally planned on using a Microsoft common file dialog, and I did use a Microsoft common file dialog.  By finding code samples that showed me how to do it.  If the component was net based originally, I think it is still NET based.  What's your point.
     What I asked for was help in modifying the compiling switches, which you never mentioned, and which I was able to find online.

Dave
0
 
LVL 35

Expert Comment

by:sarabande
ID: 40650667
Force accept
probably you meant 'forced assist' ...

Sara
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Six Sigma Control Plans

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question