Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / May 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mohan@tek.com - 24 May 2006 06:30 GMT
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:oldsyntax'
command-line
options are incompatible cl "
Can anyone help me to resolve this error?
Thanks,
Mohan
--
Barry Kelly - 24 May 2006 06:49 GMT
> Error 1 Command line error D8016 : '/MT' and '/clr:oldsyntax'
> 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

Signature

http://barrkel.blogspot.com/

mohan@tek.com - 24 May 2006 10:35 GMT
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
Barry Kelly - 24 May 2006 11:11 GMT
> 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

Signature

http://barrkel.blogspot.com/


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.