Jump to content

Compiler refuses to work

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
I'm creating a standard library of functions for a programming language I'm creating. However, my compiler (Visual C++ 2008) refuses to compile. I use one namespace, "System".

The compiler gives me the following errors:

error C2871: 'System' : a namespace with this name does not exist
error C2065: 'gcnew' : undeclared identifier
'System' : is not a class or namespace name

The rest of the errors are because of this, i.e. undeclared identifiers or whatever.

I had originally started this project as a static library, but then scrapped the idea and just changed it into a regular header. I changed my compiler settings to fit this, but it refused to do anything, so I wiped out the project and kept the code, then made a completely new project, and it still didn't work. Can someone help me?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Try to compile it with the /clr (Common Language Runtime Support) enabled. Right click solution, configuration properties, select general, and select CLR.

#3
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
That fixed the 102 errors I was getting, but it made the problem worse because now it's complaining about a system header (servprov.h). I get the following errors:

error C2872: 'IServiceProvider' : ambiguous symbol
could be 'c:\program files\microsoft sdks\windows\v6.0a\include\servprov.h(53) : System::IServiceProvider IServiceProvider'
or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::IServiceProvider'

error C3699: '*' : cannot use this indirection on type 'IServiceProvider'; compiler replacing '*' with '^' to continue parsing

...and so on. I tried each of the CLR options, and /CLR was the one with the least number of errors. /CLR:pure , /CLR:safe , and /CLR:oldSyntax didn't help any.