471,071 Members | 899 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

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

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:
do******@nest.ntu-kpi.kiev.ua
Sep 11 '05 #1
5 9614
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:
do******@nest.ntu-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.
Sep 11 '05 #2
"Boris Kuznetsov" <do******@nest.ntu-kpi.kiev.ua> wrote in message
news:dg**********@news.ntu-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).
Sep 11 '05 #3

"Boris Kuznetsov" <do******@nest.ntu-kpi.kiev.ua> wrote in message
news:dg**********@news.ntu-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
Sep 11 '05 #4
> 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.

Sep 12 '05 #5
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.
Sep 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by gc | last post: by
6 posts views Thread by Steve Crawford | last post: by
1 post views Thread by drewmania001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.