none
How do I get around C1190 and D8045 errors? RRS feed

  • Question

  • I have an ap that has some .C files and one .cpp file. When I try to compile, I get error C1190 and it says I need to add /CLR option. But when I do, then I get D8045 errors on the C files. 

    I am running this in Visual Studio 15.  Does anyone know how to get around this problem?

    • Moved by Shu 2017 Friday, September 18, 2015 7:42 AM USBView sample issue, moved from VC++ forum
    Thursday, September 17, 2015 3:58 PM

All replies

  • change the filename extension of the C files to CPP
    Thursday, September 17, 2015 4:24 PM
  • First, ask yourself if you REALLY want to use C++/CLI to produce managed code.  The project you describe doesn't sound like a great candidate for .NET.

    If you don't want your project to be a .NET project then fix whatever C++/CLI constructs you are using in the C++ file and use standard C++ code elements instead. (you didn't share the code, so I cannot suggest here).

    If you really do want a managed app, then first try compiling ONLY the CPP file with /CLR rather than the entire project.  You will likely have a number of other errors crop up since /CLR requires a bunch of other compile settings be set a specific way.  You will need to fix these additional errors too.

    Thursday, September 17, 2015 5:37 PM
  • This AP is a sample ap provided by Microsoft. I am just trying to get it to compile and run while doing minimal changes to it, until after it succeeds.

    I downloaded the windows-driver-samples-master.zip file and am trying to run the usb\usbview ap.  It came with all .c files, except the xml_helper.cpp file.

    Can you compile just the .cpp file from visual studio?  I am just using the build command right now.

    Thursday, September 17, 2015 7:48 PM
  • Well, xml_helper.cpp is clearly a C++/CLI file.  I am not sure why you would try to compile it into a driver though.  Did the driver sample come with a makefile of some sort?  What happens if you just omit the .cpp file from the build?
    Thursday, September 17, 2015 7:54 PM
  • That generated 84 errors. I think there is some syntax in C that doesn't work in CPP.

    What I don't understand is this was a sample from Microsoft, so you would think it should work right out of the box.

    Thursday, September 17, 2015 7:55 PM
  • The USBView AP can generate the USB connections in either text or XML, so it is fairly embedded in the application code.
    Thursday, September 17, 2015 8:03 PM
  • I don't see any makefile, just a .sln and a .vcxproj file
    Thursday, September 17, 2015 8:04 PM
  • Have you tried opening the .sln and building?  If nothing else, you should be able to open the build log and see the command line that was used.
    Thursday, September 17, 2015 9:35 PM
  • I found the same ap in the windows 8.1 samples and that one builds and runs fine, so I will abandon the one that came with studio 15.
    Friday, September 18, 2015 1:40 PM