By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,403 Members | 880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,403 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
"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

P: n/a

"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

P: n/a
> 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

P: n/a
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.