top of page
Search
mingnaleviteen

[Solved] Error C1189: #error: Please use the /MD switch for _AFXDLL builds[^4^]



When I build my projects I get no error, but when I hit F7 to simply build the solution, I always get this IntelliSense error:IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxver_.hI see no trace of this if building with "MSBuild MyProject.sln /v:d". The project name is empty, so I cannot trace where the error comes from, even though I'm sure I have properly set my switches/defines.Using MFC exe + MFC extension dlls (DllMain-like) + Xtreme ToolkitPro.


Hallo\nKann mir jemand in einfachen Worten erklären was mit der Einstellung Laufzeitbibliothek gemacht wird.\nUnd worin die Unterschiede bei /MT und /MD sowie /MTd und /MDd liegen. Wann wähle ich was aus?\nUnd was hat dies im Zusammenhang mit dem zu tun wie ich die MFC verwende. Hier hatte ich schon das Problem wenn ich auf statisches Linken umgestellt habe, dass ich auch hier was ändern mußte.\nGrüße\n","deleted":0,"handle":"y-vonne","pid":2058348,"tid":286150,"timestamp":1304510813000,"uid":0,"upvotes":0,"downvotes":0,"deleterUid":0,"edited":0,"votes":0,"timestampISO":"2011-05-04T12:06:53.000Z","editedISO":"","index":0,"user":"uid":0,"username":"y-vonne","userslug":"","email":"","icon:text":"?","icon:bgColor":"#aaa","groupTitle":"","status":"offline","reputation":0,"email:confirmed":0,"postcount":0,"banned":false,"banned:expire":0,"lastonline":0,"picture":"","groupTitleArray":[],"banned_until":0,"banned_until_readable":"Not Banned","signature":"","selectedGroups":[],"custom_profile_info":[],"editor":null,"bookmarked":false,"upvoted":false,"downvoted":false,"replies":"hasMore":false,"users":[],"text":"[[topic:one_reply_to_this_post]]","count":0,"selfPost":false,"display_edit_tools":false,"display_delete_tools":false,"display_moderator_tools":false,"display_move_tools":false,"display_post_menu":0},"content":"Keiner eine Erklärung?\n","deleted":0,"handle":"y-vonne","pid":2058832,"tid":286150,"timestamp":1304584576000,"uid":0,"upvotes":0,"downvotes":0,"deleterUid":0,"edited":0,"votes":0,"timestampISO":"2011-05-05T08:36:16.000Z","editedISO":"","index":1,"user":"uid":0,"username":"y-vonne","userslug":"","email":"","icon:text":"?","icon:bgColor":"#aaa","groupTitle":"","status":"offline","reputation":0,"email:confirmed":0,"postcount":0,"banned":false,"banned:expire":0,"lastonline":0,"picture":"","groupTitleArray":[],"banned_until":0,"banned_until_readable":"Not Banned","signature":"","selectedGroups":[],"custom_profile_info":[],"editor":null,"bookmarked":false,"upvoted":false,"downvoted":false,"replies":"hasMore":false,"users":[],"text":"[[topic:one_reply_to_this_post]]","count":0,"selfPost":false,"display_edit_tools":false,"display_delete_tools":false,"display_moderator_tools":false,"display_move_tools":false,"display_post_menu":0,"content":"hast du folgendes schon gelesen:\n -de/library/2kzt1wy3(v=vs.80).aspx\n","deleted":0,"handle":"Heftklammer","pid":2058976,"tid":286150,"timestamp":1304601135000,"uid":0,"upvotes":0,"downvotes":0,"deleterUid":0,"edited":0,"votes":0,"timestampISO":"2011-05-05T13:12:15.000Z","editedISO":"","index":2,"user":"uid":0,"username":"Heftklammer","userslug":"","email":"","icon:text":"?","icon:bgColor":"#aaa","groupTitle":"","status":"offline","reputation":0,"email:confirmed":0,"postcount":0,"banned":false,"banned:expire":0,"lastonline":0,"picture":"","groupTitleArray":[],"banned_until":0,"banned_until_readable":"Not Banned","signature":"","selectedGroups":[],"custom_profile_info":[],"editor":null,"bookmarked":false,"upvoted":false,"downvoted":false,"replies":"hasMore":false,"users":[],"text":"[[topic:one_reply_to_this_post]]","count":0,"selfPost":false,"display_edit_tools":false,"display_delete_tools":false,"display_moderator_tools":false,"display_move_tools":false,"display_post_menu":0,"content":"Ja deshalb auch meine Formulierung: "in einfachen Worten"\n","deleted":0,"handle":"y-vonne","pid":2058985,"tid":286150,"timestamp":1304601659000,"uid":0,"upvotes":0,"downvotes":0,"deleterUid":0,"edited":0,"votes":0,"timestampISO":"2011-05-05T13:20:59.000Z","editedISO":"","index":3,"user":"uid":0,"username":"y-vonne","userslug":"","email":"","icon:text":"?","icon:bgColor":"#aaa","groupTitle":"","status":"offline","reputation":0,"email:confirmed":0,"postcount":0,"banned":false,"banned:expire":0,"lastonline":0,"picture":"","groupTitleArray":[],"banned_until":0,"banned_until_readable":"Not Banned","signature":"","selectedGroups":[],"custom_profile_info":[],"editor":null,"bookmarked":false,"upvoted":false,"downvoted":false,"replies":"hasMore":false,"users":[],"text":"[[topic:one_reply_to_this_post]]","count":0,"selfPost":false,"display_edit_tools":false,"display_delete_tools":false,"display_moderator_tools":false,"display_move_tools":false,"display_post_menu":0,"content":"Bzgl. CRT:\n1. Die /M?d Versionen (also die mit dem kleinen d am Ende) sind die Debug Versionen. Die anderen die Release Versionen.\n2. /MD /MDd benötigt die installierten MS-CRT Runtime DLLs. Die CRT wird also aus diesen DLLs verwenden.\nz.B: fopen Codestehtin der DLL und wird aus Deiner EXE/DLL heraus in dieser DLL ausgeführt.\n3. /MT /MTd benutzt keine externen DLLs, die CRT wird statisch in Deine EXE eingebunden.\nz.B: ist der fopen Code dann Bestandteil Deiner EXE.\nBzgl: MFC.\n4. Wird die MFC als dynamische Version erzeugt (verwendet externe installierte MFC-Runtimes), dann impliziert dies auch /MD /MDd.\n5. Wird die MFC statisch gelinkt, dann muss auch die CRT statisch gebunden werden. Es impliziert also /MT /MTd.\nFür letztere Fälle gibt es entsprechende checks in\nc:\\program files (x86)\\microsoft visual studio 10.0\\vc\\atlmfc\\include\\afxver_.h\n#if defined(_AFXDLL) && !defined(_DLL)\n\t#error Please use the /MD switch for _AFXDLL builds\n#endif\n\nund\nc:\\program files (x86)\\microsoft visual studio 10.0\\vc\\atlmfc\\include\\afx.h\n#ifdef _DLL\n#ifndef _AFXDLL\n#error Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]\n#endif\n#endif\n\nHTH\n","deleted":0,"pid":2059006,"tid":286150,"timestamp":1304603477000,"uid":12371,"upvotes":0,"downvotes":0,"deleterUid":0,"edited":0,"votes":0,"timestampISO":"2011-05-05T13:51:17.000Z","editedISO":"","index":4,"user":"uid":12371,"username":"Martin Richter","userslug":"martin-richter","reputation":35,"postcount":15721,"picture":"/forum/assets/uploads/profile/12371-profileavatar.png","signature":"","banned":false,"banned:expire":0,"status":"offline","lastonline":1675780192169,"groupTitle":"[\"\"]","groupTitleArray":[""],"icon:text":"M","icon:bgColor":"#f44336","lastonlineISO":"2023-02-07T14:29:52.169Z","banned_until":0,"banned_until_readable":"Not Banned","selectedGroups":["name":"Mod","slug":"../user/martin-richter","labelColor":"#db001d","icon":"fa-gavel","userTitle":"Mod"],"custom_profile_info":[],"editor":null,"bookmarked":false,"upvoted":false,"downvoted":false,"replies":"hasMore":false,"users":[],"text":"[[topic:one_reply_to_this_post]]","count":0,"selfPost":false,"display_edit_tools":false,"display_delete_tools":false,"display_moderator_tools":false,"display_move_tools":false,"display_post_menu":0,"content":"@ Martin Richter: Ja hat geholfen. THX.\n","deleted":0,"handle":"y-vonne","pid":2059304,"tid":286150,"timestamp":1304660154000,"uid":0,"upvotes":0,"downvotes":0,"deleterUid":0,"edited":0,"votes":0,"timestampISO":"2011-05-06T05:35:54.000Z","editedISO":"","index":5,"user":"uid":0,"username":"y-vonne","userslug":"","email":"","icon:text":"?","icon:bgColor":"#aaa","groupTitle":"","status":"offline","reputation":0,"email:confirmed":0,"postcount":0,"banned":false,"banned:expire":0,"lastonline":0,"picture":"","groupTitleArray":[],"banned_until":0,"banned_until_readable":"Not Banned","signature":"","selectedGroups":[],"custom_profile_info":[],"editor":null,"bookmarked":false,"upvoted":false,"downvoted":false,"replies":"hasMore":false,"users":[],"text":"[[topic:one_reply_to_this_post]]","count":0,"selfPost":false,"display_edit_tools":false,"display_delete_tools":false,"display_moderator_tools":false,"display_move_tools":false,"display_post_menu":0],"category":"bgColor":"#198553","cid":19,"class":"col-md-3 col-xs-6","color":"#fff","description":"Fragen zu den MFC (Microsoft Foundation Classes). WinForms haben mit MFC übrigens nichts zu tun.","descriptionParsed":"Fragen zu den MFC (Microsoft Foundation Classes). WinForms haben mit MFC übrigens nichts zu tun.\n","disabled":0,"icon":"hidden","imageClass":"cover","link":"","name":"MFC","numRecentReplies":1,"order":1,"parentCid":33,"post_count":172637,"slug":"19/mfc","topic_count":32644,"isSection":0,"totalPostCount":172637,"totalTopicCount":32644,"tagWhitelist":[],"thread_tools":[],"isFollowing":false,"isNotFollowing":true,"isIgnoring":false,"bookmark":null,"postSharing":[],"deleter":null,"merger":null,"related":[],"unreplied":false,"icons":[],"breadcrumbs":["text":"[[global:home]]","url":"/forum/","text":"C++ (alle ISO-Standards)","url":"/forum/category/33/c-alle-iso-standards","text":"MFC","url":"/forum/category/19/mfc","text":"Laufzeitbibliothek"],"privileges":"topics:reply":false,"topics:read":true,"topics:tag":false,"topics:delete":false,"posts:edit":false,"posts:history":false,"posts:delete":false,"posts:view_deleted":false,"read":true,"view_thread_tools":false,"editable":false,"deletable":false,"purge":false,"view_deleted":false,"isAdminOrMod":false,"disabled":0,"tid":"286150","uid":0,"topicStaleDays":60,"reputation:disabled":0,"downvote:disabled":0,"bookmarkThreshold":5,"postEditDuration":0,"postDeleteDuration":0,"scrollToMyPost":true,"allowMultipleBadges":false,"rssFeedUrl":"/forum/topic/286150.rss","postIndex":0,"pagination":"prev":"page":1,"active":false,"next":"page":1,"active":false,"rel":[],"pages":[],"currentPage":1,"pageCount":1,"loggedIn":false,"relative_path":"/forum","template":"name":"topic","topic":true,"url":"/forum/topic/286150/laufzeitbibliothek","bodyClass":"page-topic page-topic-286150 page-topic-laufzeitbibliothek page-topic-category-19 page-topic-category-mfc page-status-200","loggedInUser":"uid":0,"username":"[[global:guest]]","picture":"","icon:text":"?","icon:bgColor":"#aaa","widgets":"footer":["html":"\r\nDatenschutz ]}Looks like your connection to C++ Community was lost, please wait while we try to reconnect.




error please use the md switch for afxdll builds

2ff7e9595c


0 views0 comments

Recent Posts

See All

Commentaires


bottom of page