Command Line Error D8045
Contents |
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners command line error d8016 ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9
Error D8045 Cannot Compile C File With The /clr Option
Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you line app error requested has been removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++ Build Errors Command-Line Errors D8000 Through D9999 Command-Line Errors
Visual Studio /tp
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 visual studio clr option 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
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 https://msdn.microsoft.com/en-us/library/abb82cy0.aspx of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to compile c code in visual c++ express 2010 up vote 4 down vote favorite 2 I am trying to compile c code in VS C++ express 2010 but I get the following error http://stackoverflow.com/questions/6062101/how-to-compile-c-code-in-visual-c-express-2010 trace: 1>------ Build started: Project: test4, Configuration: Release Win32 ------ 1>cl : Command line error D8045: cannot compile C file 'test4.c' with the /clr option ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== When I try and compile with cpp extension I get this error trace: 1>------ Build started: Project: test4, Configuration: Release Win32 ------ 1> test4.cpp 1>c:\documents and settings\rkelly1\desktop\io\test4\test4\pt_ioctl.c(86): error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 1>c:\documents and settings\rkelly1\desktop\io\test4\test4\pt_ioctl.c(98): error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 1>c:\documents and settings\rkelly1\desktop\io\test4\test4\pt_ioctl.c(138): error C2664: 'OpenServiceW' : cannot convert parameter 2 from 'const char [9]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 1>c:\documents and settings\rkelly1\desktop\io\test4\test4\pt_ioctl.c(196): error C2664: 'GetSystemDirectoryW
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 http://stackoverflow.com/questions/7668161/how-can-i-create-a-single-visual-studio-project-that-mixes-c-and-c-using-clr 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 command line 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 command line error 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 Al