Error D8045
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 Channel
Line App Error
9 Documentation APIs and reference Dev centers Retired content Samples We’re visual studio /tp sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Ask a question
Visual Studio Clr Option
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 ' Command line error D8045 : cannot
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 D8045: cannot compile C file 'serialcommands.c' with the /clr option https://social.msdn.microsoft.com/Forums/en-US/b1bd7f93-2b5a-45f7-895c-9eda446f92ff/how-to-compile-c-using-visual-c?forum=Vsexpressvc up vote 7 down vote favorite I am getting compiler error D8045. cannot compile C file 'serialcommands.c' with the /clr option. This file is a C library that has been written to talk over a serial port to a TI processor. The task that I need to do is wrap this library with a CLR wrapper (there will be additional questions posted to stackoverflow concerning marshalling data back http://stackoverflow.com/questions/880413/d8045-cannot-compile-c-file-serialcommands-c-with-the-clr-option and forth if you want some more easy points from CLI questions.) I just want to use this C library from my CLR wrapper. I went to Properties->Configuration Properties->C/C++->General->Compile with Common Language runtime support = No Common Language Runtime support Is this the correct way to do this? Will I experience nasty weird bugs later or are other things that I need to do to use this? .net c++-cli clr share|improve this question edited Mar 9 '15 at 14:55 Deduplicator 27.9k63265 asked May 19 '09 at 0:20 MedicineMan 5,4402172117 as a follow up, I am now a year out from using this solution and never have experienced any problems as a result of using this solution. No "wierdness" as I feared. –MedicineMan May 18 '10 at 17:26 add a comment| 1 Answer 1 active oldest votes up vote 8 down vote accepted Yes. You need to compile any C objects without /CLR, since the clr only understands classes and objects. You can still use them from your C++/CLI project, wrapped inside of your "ref class" objects. This is a normal way of wrapping a C api in .NET objects. share|improve this answer answered May 19 '09 at 0:25 Reed Copsey 395k3779
here for a quick overview of the site Help Center Detailed answers to http://stackoverflow.com/questions/6062101/how-to-compile-c-code-in-visual-c-express-2010 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 visual studio 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 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 line app error C++ express 2010 but I get the following error 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 p