Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > VS6 : Fatal error C1021: invalid preprocessor command 'using'

Reply
Thread Tools

VS6 : Fatal error C1021: invalid preprocessor command 'using'

 
 
Boris Kuznetsov
Guest
Posts: n/a
 
      09-11-2005
This occurs in an empty project when I add the following string:

#using <mscorlib.dll>

Can anyone tell me why would #using ... not be working???? MSDN says nothing
about this error.
Please advice what to do??

mailto:
http://www.velocityreviews.com/forums/(E-Mail Removed)-kpi.kiev.ua


 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      09-11-2005
Boris Kuznetsov wrote:
> This occurs in an empty project when I add the following string:
>
> #using <mscorlib.dll>
>
> Can anyone tell me why would #using ... not be working???? MSDN says nothing
> about this error.
> Please advice what to do??
>
> mailto:
> (E-Mail Removed)-kpi.kiev.ua
>
>


#using is not part of the standard C++ language, it is a microsoft
extension and therfore you need a microsoft group.
news:microsoft.public.vc.language for instance.
 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      09-11-2005
"Boris Kuznetsov" <(E-Mail Removed)-kpi.kiev.ua> wrote in message
news:dg0uh3$eti$(E-Mail Removed)-kpi.kiev.ua...
> This occurs in an empty project when I add the following string:
>
> #using <mscorlib.dll>
>
> Can anyone tell me why would #using ... not be working???? MSDN says
> nothing about this error.
> Please advice what to do??


(Since I don't believe this is actualy a Microsoft problem I'm answering it
here).

Error C1021 basically says, No such thing as #using

So, #using <mscorlib.dll> is neither Microsoft, or C++. What is it you
are trying to do?

I believe you actually want to include the header file(s) for mscorlib using
#include
and link mscorlib.dll to your program (you'll need to read docs or check
microsoft
newsgroup for that one).


 
Reply With Quote
 
Mike Wahler
Guest
Posts: n/a
 
      09-11-2005

"Boris Kuznetsov" <(E-Mail Removed)-kpi.kiev.ua> wrote in message
news:dg0uh3$eti$(E-Mail Removed)-kpi.kiev.ua...
> This occurs in an empty project when I add the following string:
>
> #using <mscorlib.dll>


First let's ask: What prompted you to write such a line?

>
> Can anyone tell me why would #using ... not be working????


Well, it doesn't work in the standard C++ language (the only topic here),
because it has no such directive. Did you perhaps really intend to
write:

#include <mscorlib.dll>

>MSDN says nothing about this error.


It certainly does.

From
http://msdn.microsoft.com/library/de...html/C1021.asp

== begin quote ==

Visual C++ Concepts: Building a C/C++ Program

Fatal Error C1021
invalid preprocessor command 'string'


string is not a valid preprocessor directive. To resolve the error,
use a valid preprocessor name for string. The following sample
generates C1021:

// C1021.cpp
#BadPreProcName // C1021, delete line
int main() {
}

== begin quote ==

> Please advice what to do??


Use a valid preprocessor directive, or if that string is some
special Microsoft extension, consult your documentation and/or
a Microsoft specific newsgroup about how to use it, when, why,
etc.

-Mike


 
Reply With Quote
 
persenaama
Guest
Posts: n/a
 
      09-12-2005
> Did you perhaps really intend to write:
>
> #include <mscorlib.dll>


No, mscorlib.dll is part of Managed C++ / .NET and #using is how the
component is used and has nothing to do with non-managed ISO/IEC C++.
What he wrote is correct in that part, just off-topic.

He should consult his project settings to see if the managed
compilation is enabled or not and proceed to appropriate groups for
follow-up questions.

 
Reply With Quote
 
Ron Natalie
Guest
Posts: n/a
 
      09-12-2005
persenaama wrote:
>>Did you perhaps really intend to write:
>>
>>#include <mscorlib.dll>

>
>
> No, mscorlib.dll is part of Managed C++ / .NET and #using is how the
> component is used and has nothing to do with non-managed ISO/IEC C++.
> What he wrote is correct in that part, just off-topic.


Visual Studio 6 has no clue what Managed C++ / .NET is, which is
probably therefore his problem.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile Error using C++ VS6.0 using Notes API Andrew Luke C++ 3 09-09-2005 01:33 PM
Compiler error occurred when try to use a flexible template expression in preprocessor definesCompiler error occurred when try to use a flexible template expression in preprocessor defines snnn C++ 6 03-14-2005 04:09 PM
preprocessor, token concatenation, no valid preprocessor token Cronus C++ 1 07-14-2004 11:10 PM
PyNew_Interpreter(): "Fatal Python error, invalid thread state for this thread" question vincent wehren Python 0 12-11-2003 08:09 PM
VS.NET 2003 debugging became very slow after installing VS6 side by side Andy Chau ASP .Net 0 11-20-2003 01:19 AM



Advertisments