How to resolve :Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line - DOTNET

This is a discussion on How to resolve :Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line - DOTNET ; Hi all, I have ported my project from VS2003 to VS2005 The project contains both unmanaged codeand managed code.While compiling I got the following errors: Error 1 Command line error D8016 : '/MT' and '/clr ldsyntax' command-line options are incompatible ...

+ Reply to Thread
Results 1 to 4 of 4

How to resolve :Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line

  1. Default How to resolve :Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line

    Hi all,
    I have ported my project from VS2003 to VS2005
    The project contains both unmanaged codeand managed code.While
    compiling
    I got the following errors:
    Error 1 Command line error D8016 : '/MT' and '/clrldsyntax'
    command-line
    options are incompatible cl "
    Can anyone help me to resolve this error?
    Thanks,
    Mohan
    --


  2. Default Re: How to resolve :Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line

    "mohan@tek.com" <mohan@tek.com> wrote:

    > Error 1 Command line error D8016 : '/MT' and '/clrldsyntax'
    > command-line
    > options are incompatible cl "
    > Can anyone help me to resolve this error?


    I've just looked at the documentation for the '/clr' switch. It says, in
    the documentation, this:

    ---8<---
    By default, /clr is not in effect. When /clr is in effect, /MD is also
    in effect (see for /MD, /MT, /LD (Use Run-Time Library) more
    information). /MD ensures that the dynamically linked, multithreaded
    versions of the runtime routines are selected from the standard header
    (.h) files. Multithreading is necessary for managed programming in part
    because the CLR garbage collector runs finalizers in an auxiliary
    thread.
    --->8---

    Does this help?

    -- Barry

    --
    http://barrkel.blogspot.com/

  3. Default Re: How to resolve :Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line

    hanks Barry. But after selecting /MD options ,I am getting some
    different error.

    Error 1 error C2440:cannot convert from '__const_Char_ptr' to 'wchar_t
    __gc *' 28


    Can you please let me that how can I convert? I have tried reinterpret.
    But it does not convert.
    For your reference I have attached the piece of code:

    wchar_t __gc* GetAssemblyPath()
    {
    return PtrToStringChars(Assembly::GetExecutingAssembly()->Location);
    }

    Thanks,
    Mohan


  4. Default Re: How to resolve :Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line

    "mohan@tek.com" <mohan@tek.com> wrote:

    > hanks Barry. But after selecting /MD options ,I am getting some
    > different error.
    >
    > Error 1 error C2440:cannot convert from '__const_Char_ptr' to 'wchar_t
    > __gc *' 28


    It helps when you supply the full error (the full error is on the Output
    page or on the command line). The full error is:

    ---8<---
    error C2440: 'return' : cannot convert from '__const_Char_ptr' to
    'wchar_t __gc *'
    Conversion loses qualifiers
    --->8---

    The problem is that __const_Char_ptr has a const qualifier, while the
    declared return type of the function is non-const. You need to add
    'const':

    ---8<---
    const wchar_t __gc* GetAssemblyPath()
    {
    return PtrToStringChars(Assembly::GetExecutingAssembly()->Location);
    }
    --->8---

    Or alternatively, use const_cast<> to cast it away.

    -- Barry

    --
    http://barrkel.blogspot.com/

+ Reply to Thread

Similar Threads

  1. Python command line error
    By Application Development in forum Python
    Replies: 2
    Last Post: 05-28-2007, 09:01 PM
  2. Error while compiling from command line
    By Application Development in forum basic.visual
    Replies: 1
    Last Post: 04-18-2007, 11:33 AM
  3. Command line error: STSADM
    By Application Development in forum Sharepoint
    Replies: 0
    Last Post: 06-26-2006, 10:22 AM
  4. 421 5.5.2 Syntax Error Command Line too Long
    By Application Development in forum Inetserver
    Replies: 1
    Last Post: 08-05-2005, 05:17 PM
  5. 421 5.5.2 Syntax Error Command Line too Long
    By Application Development in forum Microsoft Exchange
    Replies: 0
    Last Post: 07-03-2005, 10:01 PM