473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 9823
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and...
6
by: o'seally | last post by:
solaris/linux admins/rookie_developers that battle with this error are probably all frustrated when it happens. i bet you're also somehow frustrated by this seemingly unsolvable error :-) ...take...
0
by: SHC | last post by:
Hi all, I have a VC++ .NET 2003 - Windows XP Pro PC. I created a Win32 console application in my VC++ .NET 2003 and copied validateDOM.cpp, books.xml and books.xsd (see the attached files below)...
5
by: George | last post by:
I'm getting an internal compiler error from Visual C++ .NET 2003 when I'm using managed extensions. Here is the error. Generating Code... c:\development\icu\source\common\uhash.c(869) : fatal...
0
by: Greg | last post by:
Hi, creating template1 database in /var/pgsql/data1/base/1... DEBUG: invoking IpcMemoryCreate(size=1081344) FATAL: shmat(id=1179648) failed: Invalid argument What's the problem why is shmat...
6
by: Steve Crawford | last post by:
I've started seeing the following in my logs: FATAL: invalid frontend message type 8 I searched back over a month and there are 5 instances of this error of which 4 are in the last 24 hours. ...
1
by: drewmania001 | last post by:
i've read various info on the web including the following http://php.mirrors.ilisys.com.au/manual/en/ref.mysqli.php mySQL Version 4.1.16 PHP Version 5.1.2 with Zend Engine v2.1.0 OS Windows...
10
by: sachinv1821 | last post by:
hi , i am Getting this Error fatal error C1189: #error : "eh.h is only for C++!" my Problem is i am Having C++ librabry and Appropriate .h file i want to Access Them is .c File Files..... to Be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.