Error D8045 Cannot Compile With The /clr Option
Contents |
SQL Server 2014 Express resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs line app error Channel 9 Documentation APIs and reference Dev centers Retired content Samples
Visual Studio Clr Option
We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Ask visual studio /tp a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: How to compile C using Visual C++? Archived Forums V > Visual C++ Express Edition Question 0 Sign in to vote Is that possible at all? If it is, what are the steps to compile a C program in Visual C++? When I start up a new project, what kind of project I should pick? Many thanks! Monday, September 18, 2006 6:05 PM Answers 0 Sign in to vote Take a look at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=454672&SiteID=1 Thanks, Ayman Shoukry VC++ Team Monday, September 18, 2006 6:14 PM 0 Sign in to vote Try creating a simple console application and don't ask for .NET support. Monday, September 18, 2006 8:42 PM All replies 0 Sign in to vote Take a look at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=454672&SiteID=1 Thanks, Ayman Shoukry VC++ Team Monday, September 18, 2006 6:14 PM 0 Sign in to vote Thanks Ayman! I changed the compile option to compile the file as /TC, however, when I built the project, I still got the following error: cl : Command line error D8045 : cannot compile C file '.\Stdafx.cpp' with the /clr option Is there something else I will need to change besides the compile option at Properties? Thanks! Monday, September 18, 2006 6:43 PM 0 Sign in to vote Try creating a simple console application and don't ask for .NET support. Monday, September 18, 2006 8:42 PM 0 Sign in to vote hii get the following error ' Com
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: https://social.msdn.microsoft.com/Forums/en-US/b1bd7f93-2b5a-45f7-895c-9eda446f92ff/how-to-compile-c-using-visual-c?forum=Vsexpressvc Sign up Compiling C to use the CLR [duplicate] up vote 3 down vote favorite Possible Duplicate: Compiling C code for .NET I have a bunch of C source code and I want to compile it so it uses the .NET framework. I downloaded Microsoft Visual C++ and chose new CLR project. I then added all my C code, and I tried http://stackoverflow.com/questions/3651959/compiling-c-to-use-the-clr to compile the files. It said cl : Command line error D8045: cannot compile C file '..\..\..\..\..\Downloads\lzma912\C\XzDec.c' with the /clr option Why can't I compile this? .net c share|improve this question edited Sep 6 '10 at 14:12 Joe Gauterin 10.8k2555 asked Sep 6 '10 at 13:48 Leo Izen 2,14351949 marked as duplicate by cHao, Jason, Joe Gauterin, George Stocker♦, Hans Olsson Sep 7 '10 at 20:20 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 3 Why are you so aggressive ? –Cedric H. Sep 6 '10 at 14:03 4 IMHO, it is rude to close a question as "exactly duplicate" of a question that itself was closed as "not a real question"! –RBerteig Sep 6 '10 at 21:45 4 +1 to offset the downvoting. This is a reasonable question, in spite of the pre-emptive ranting by the OP. Given the way some folk dump on anything from MS without thinking, I'm sympathetic. But honestly, just editing the rant out was enough, it really d
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about http://stackoverflow.com/questions/30329574/compile-c-code-with-clr-option hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask http://stackoverflow.com/questions/7668161/how-can-i-create-a-single-visual-studio-project-that-mixes-c-and-c-using-clr Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Compile C code with /clr option up vote -1 down vote favorite I have library project that is compiled with /CLR option. Now I need to connect to WCF server using visual studio native CPP WCF client. During compilation I got error Error 1 error D8045: cannot compile C file 'schemas.microsoft.com.2003.10.Serialization.xsd.c' with the /clr option How to solve this problem? c++ visual-c++ share|improve this question asked May 19 '15 at 15:14 vico 2,63063471 1 Hmm, pretty unclear what you hope to accomplish with WCF from a C source file. Anyhoo, the /CLR option requires a C++ source file. A starting point is to force it to get compiled as C++, error d8045 cannot might just work. Right-click the file > Properties > C/C++ > Advanced > Compile As = Compile as C++ Code. –Hans Passant May 19 '15 at 15:24 Or just rename the file as .cpp, less confusing for you when you come back and see C++ syntax in a C file, or try to add it to another project. –Ben Voigt May 19 '15 at 15:33 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote Use the /TP flag to force the CLR compiler to treat it like a C++ file: https://msdn.microsoft.com/en-us/library/abb82cy0(VS.80).aspx share|improve this answer answered May 19 '15 at 15:25 Maurice Reeves 1,120720 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged c++ visual-c++ or ask your own question. asked 1 year ago viewed 146 times active 1 year ago Related 1Why does this pointer to C++ function code generate a compile error?9getting the right compiler for C++2MS VC++ 6 command line compile gets error RC1015: cannot open include file 'afxres.h'473Why is this program erroneously rejected by three C++ c
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How can I create a single Visual Studio project that mixes C and C++ using CLR? up vote 4 down vote favorite I am working on porting code that builds on GCC on Unix to windows using Visual Studio 2008. I would like to create a single executable that does not depend on any dll(s) of my own creation and only built in ones to the Windows operating system. My code includes zlib which itself includes C files which I can build and link fine into my Unix executable. In my beginning attempts to build, the first error I hit is that the C code from zlib cannot be built with CLR since it is not C++. I see some suggesting to break this out into a separate DLL which would be linked into my executable but I'd like to avoid the complexity of shared libraries if possible. (Perhaps this avoidance is even more complex?) Is there a way to mix my C++ with the C code of zlib into a single executable with CLR? My current build error is the following: 1>cl : Command line error D8045 : cannot compile C file '..\src\zlib-1.2.5\zutil.c' with the /clr option c++ c visual-studio-2008 clr porting share|improve this question asked Oct 5 '11 at 21:48 WilliamKF 10.8k33108207 You cannot create a program with /clr compiled object files that do not have a dependency. Short from .NET having to be installed, you will also need to deploy the DLL version of the CRT. –Hans Passant Oct 5 '11 at 22:15 1 You might like to have a look here msdn.microsoft.com/en-us/library/x0w2664k. –alk Oct 6 '11 at 19:36 Also there does exist a win32 port for some zlib version: gnuwin32.sourceforge.net/packages/zlib.htm –alk Oct 6 '11 at 19:39 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted You could change it to cpp to get it compiled by the C++ compiler (and fix any compile errors that introduces). That may be more difficult than just