Thread: problem with #using <mscorlib.dll>

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    163

    problem with #using <mscorlib.dll>

    I'm learning how to use Microsoft Visual Studio 2005.

    I try to include #using <mscorlib.dll>

    but got this error when I compile

    "fatal error C1190: managed targeted code requires a '/clr' option"

    What is the problem? I tried MSDN but it gives answer that nobody understands

  2. #2
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Have you tried reading the help files with the IDE? Being a MS version, it may give you an explanation, or better still, how you can solve the problem

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The #using directive is specific to C++/CLR. You need to enabled C++/CLR in the project options.

    Or if you want to go for normal C++, don't use #using.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Looks like you are trying to use a managed C++ library within unmanaged code.

    If you programming in straight C++, and not in .NET, you cannot use that library.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Registered User
    Join Date
    Dec 2004
    Posts
    163
    I found the instructions on how to sset /clr on!
    http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx

    I got a problem, I need to control directories and this link is great http://faq.cprogramming.com/cgi-bin/...&id=1044780608

    but it can only work in msvc++ 6, not on ms visual studio 2005. Anyone knows what is the problem?

    but I use #using <mscorlib.dll>, which is in .net platform, then my code can't be run in msvc++ 6.

    my problem is i need to be independent across the complier. thanks!

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    /clr is compiler-specific, so it's of course a big no-no.

    Just follow the instructions in the other thread: install the PSDK and the API code will work in 2005.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 05:46 PM