Command Line Error D8045 Cannot Compile C File
Contents |
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 Channel 9 Documentation line app error APIs and reference Dev centers Retired content Samples We’re sorry. The
Visual Studio /tp
content you requested has been removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++ Build
Visual Studio Clr Option
Errors Command-Line Errors D8000 Through D9999 Command-Line Errors D8000 Through D9999 Command-Line Error D8045 Command-Line Error D8045 Command-Line Error D8045 Command-Line Error D8016 Command-Line Error D8021 Command-Line Error D8022 Command-Line Error D8027 Command-Line Error D8036 Command-Line Error D8037 Command-Line Error D8045 Command-Line Warning D9024 Command-Line Warning D9025 Command-Line Warning D9026 Command-Line Warning D9027 Command-Line Warning D9028 Command-Line Warning D9035 Command-Line Warning D9036 Command-Line Warning D9040 Command-Line Warning D9041 Command-Line Warning D9043 TOC Collapse the table of content Expand the table of content This documentation is archived and is not being maintained. This documentation is archived and is not being maintained. Command-Line Error D8045 Visual Studio 2015 Other Versions Visual Studio 2013 Visual Studio 2012 Visual Studio 2010 Visual Studio 2008 Visual Studio 2005 cannot compile C file 'file' with the /clr optionOnly C++ source code files can be passed to a compilation that uses /clr. Use /TP to compile a .c file as a .cpp file; see /Tc, /Tp, /TC, /TP (Specify Source File Type) for more information.For more information, see /clr (Common Language Runtime Compilation).D8045 can also occur if you compile an ATL application using Visual C++. See How to: Migrate to /clr for more information. Show: Inherited Protected Print Export (0) Print Export (0) Share IN THIS ARTICLE Is this page helpful? Yes No Additional feedback? 1500 characters remaining Submit Skip this Thank you! We appreciate your feedback. Dev centers Windows Office Visual Studio Microsoft Azure More... Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine Community Forums Blogs Codeplex Support Self support Programs BizSpark (for startups) Microsoft Imagine (for stud
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 https://msdn.microsoft.com/en-us/library/abb82cy0.aspx 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 to http://stackoverflow.com/questions/3651959/compiling-c-to-use-the-clr 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 didn't deserve a bl
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 http://stackoverflow.com/questions/7668161/how-can-i-create-a-single-visual-studio-project-that-mixes-c-and-c-using-clr 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 visual studio 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 command line error 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.8k33108204 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 a