none
how to solve command line error D8016 RRS feed

  • Question

  •    i made up a small aplication but  during compliation i ended up having comaand line errors,

    after resolving few of thoese errors, through form help, i am stuck again, 

    this error D8016  after  i resolved error C1190  managed targeted code  requires '/clr' option

    but the problem now  is the  this error  , Command line error D8016 : '/MT' and '/clr' command-line options are incompatible cl 

    some one please help me out in this, Thankyou

    Wednesday, August 30, 2006 11:09 AM

Answers

  • Hi,
    the /clr option isn't compatible with the /MT (multi threaded). Check this page to see the restrictions when using the /clr:
    http://msdn2.microsoft.com/en-us/library/ffkc918h.aspx

    To solve the problem, go to your project properties->C/C++->Code Generation->Runtime Library->Multi-threaded Debug DLL (/MDd)
    (or Multi-threaded DLL (/MD) for release configuration)
    Wednesday, August 30, 2006 11:53 AM
  • Try doing what the compiler says, adding the #define _AFXDLL or you can use the preprocessor options in project properties->c/c++->preprocessor->preprocessor definitions
    add a ; if you need to separate from another definition and add _AFXDLL

    As for your other question about the terms:
    - CRT - C Run-Time libraries, the libraries that contain the information about the C standard functions

    - DLL - Dynamic Linked Library is a library that instead of being "merged" with the executable like a static library (.lib files), it stays in a separate file that is loaded when needed by your application.

    - AFXDLL - This is shared version of the MFC libraries.

    This kind of terms/acronyms can be found easily in google/wikipedia and other resources if you don't want to wait for a response here ;)

    Hope this helps with your problems.
    Thursday, August 31, 2006 12:24 PM

All replies

  • That's correct. Mixed-mode compilation won't allow static CRT linkage. Use /MD (which uses the DLL version of the CRT).
    Wednesday, August 30, 2006 11:48 AM
    Moderator
  • Hi,
    the /clr option isn't compatible with the /MT (multi threaded). Check this page to see the restrictions when using the /clr:
    http://msdn2.microsoft.com/en-us/library/ffkc918h.aspx

    To solve the problem, go to your project properties->C/C++->Code Generation->Runtime Library->Multi-threaded Debug DLL (/MDd)
    (or Multi-threaded DLL (/MD) for release configuration)
    Wednesday, August 30, 2006 11:53 AM
  •  
     Thanks  for the help , but  it seems these  erros wont go away,  ,i did  as u u told me to do , i changed  the settign , and made it Multithreaded Debug DLL

    but now there is another  Error .Error 1 fatal error C1189: #error :  Building MFC application with /MDDrinks (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MDDrinks C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h 24

    And one more thing,  would be a gr8 help  As  u must have realsied  that im really  very new to it , and i really dont get wht all these Terms  mean ...

    Afx DLL and Crt ... ,/Md ...., DLLm,CRT As  these werent explain  in the book  which im using to learn "Sams TeachYourself VisualC++.net ....So kindly  cud u explain me a bit about these so dat i can know whts going on, , as it s no use to do wht other tell u to do, unless u  ur self  dont know wht  u doing is for  wht? 

    Many thanks

     

     

    Thursday, August 31, 2006 5:16 AM
  • Try doing what the compiler says, adding the #define _AFXDLL or you can use the preprocessor options in project properties->c/c++->preprocessor->preprocessor definitions
    add a ; if you need to separate from another definition and add _AFXDLL

    As for your other question about the terms:
    - CRT - C Run-Time libraries, the libraries that contain the information about the C standard functions

    - DLL - Dynamic Linked Library is a library that instead of being "merged" with the executable like a static library (.lib files), it stays in a separate file that is loaded when needed by your application.

    - AFXDLL - This is shared version of the MFC libraries.

    This kind of terms/acronyms can be found easily in google/wikipedia and other resources if you don't want to wait for a response here ;)

    Hope this helps with your problems.
    Thursday, August 31, 2006 12:24 PM
  •  hey  thanks ,  i will try them out  tommoro as me off  at the moment but as far as  i remember i did the  chnage the preprocessor defination before nas well , like it but i will  go through it again,,

    and yes  ur rite but  on google  u dont really  good teachers,  but yea to save time   ur right, 

    but i really  need a guideline form start , who can tell how to go thorugh as i have changed my strategy and now  rather  then useing Sams teach ur self  book , im refering to msdn library to learn VC,   but i need  ur or any other person ehlp who can  help step by step  to learn it,  as i have chosed to  start programming after  long time, and  i have forgotten many things but a easyguide  can refreash my mind , and i can b  back on track , and  i have learned  VC is very diffcult  to grab,& handle ,,,so i dont know but as my manger  has given me limited time to get hang of this  Vc.

    but in ny case  Thanks  and  if tommoro  i get anbother i will post back again ;) LOL.

    Thursday, August 31, 2006 4:16 PM
  • Hi, the errro of _AFXDLL is still there   !!!! i even  #define _AFXDLL infact i had doen it before  u told me , but i went in project properties went to preprocessor  defination but wht to do next from here

    " add a ; if you need to separate from another definition and add _AFXDLL "      I ADDED THE  _AFXDLL THERE  BUT DAT didnt  help aswell the error is still there

     error C1189: #error :  Building MFC application with /MDDrinks (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MDDrinks C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h 24 

     stuck solution need

    Thanks

    Monday, September 4, 2006 4:59 AM
  • I don't see why that didn't work. Try creating a new thread/search for that existing problem so that others can help you with it (since this thread is marked as answered many people won't read it).
    Tuesday, September 5, 2006 9:27 AM
  • ur solution worked for me ...

    thanx  a lot ..had been stuck there fr hours ...


    Wednesday, February 14, 2007 4:14 AM
  • Hi,
    the /clr option isn't compatible with the /MT (multi threaded). Check this page to see the restrictions when using the /clr:
    http://msdn2.microsoft.com/en-us/library/ffkc918h.aspx

    To solve the problem, go to your project properties->C/C++->Code Generation->Runtime Library->Multi-threaded Debug DLL (/MDd)
    (or Multi-threaded DLL (/MD) for release configuration)

    Hi,

    Please help me. This is not working in all cases. Since, /MD requires DLLs, in some systems I am getting errors such as " msvcr110.dll missing from your system". What can be done to resolve this issue.? Thanks in advance.

    Wednesday, September 21, 2016 12:22 PM
  • Hi,

    Please help me. This is not working in all cases. Since, /MD requires DLLs, in some systems I am getting errors such as " msvcr110.dll missing from your system". What can be done to resolve this issue.? Thanks in advance.

    Instead of adding a request for assistance to a closed thread from 10 years ago I suggest you start a new thread in which you ask your question and provide relevant details about your code.
    Wednesday, September 21, 2016 12:31 PM