Skip to main content

Link Error LNK2001: Unresolved External Symbol _mainthread

To avoid these unresolved external errors, do not set the Project Settings to Single-Threaded for an MFC version 3.0 or later application. This setting can be changed by doing the following:
  • On Microsoft Visual C++ .NET 2003
    1. Click the Project menu.
    2. Click <project_name> Properties.
    3. Expand Configuration Properties, and then click C/C++.
    4. Click Code Generation.
    5. In the right pane, make a selection other than Single-threaded or Single-threaded Debug in the Runtime Library list.
  • On Microsoft Visual C ++ 2.x, 5.0, and 6.0
    1. Select the Project menu.
    2. Select the Settings... option.
    3. Select the C/C++ tab.
    4. Select Code Generation on the Category list box.
    5. Finally, make a selection other than Single-Threaded on the Use Run Time Library list box.
  • On Microsoft Visual C++ 4.x
    1. Select the Build menu.
    2. Select the Settings... option.
    3. Select the C/C++ tab.
    4. Select Code Generation on the Category list box.
    5. Finally, make a selection other than Single-Threaded on the Use Run Time Library list box.
Note In Visual Studio 2005 and in later versions, single-threaded CRT is no longer available. For more information, visit the following MSDN Web sites:
C run-time libraries

Comments

Popular posts from this blog

Microservice Architecture

Agile development & Deployment is difficult in case of ____ Monolithic Software built as microservices can, by definition, be broken down into multiple component services ? True Separating components with conflicting resource requirements falls under the bucket of _ Microservices Complexity of developing, testing & deploying distributed system, Handling partial failures account to disadvantages of Microservices Benefits of Microservices include - All the options Decomposition of Microservices based on 2 categories namely Business capability , Subdomain Simple to Develop, Test, Deploy, Scale represents ____ Monolithic Is Microservice is considered as subset of SOA ? True The 3Cs of Microservices includes all these except Control Microservice Architecture adapts following concepts All the options The client expects a timely response from the service and might even block while it waits represents__client service interaction styles Synch...

What is Document/View Architecture in MFC?

By default MFC application wizard creats with an skeleton with a document class and another is view class.MFC seperates data management into these two class.The document class store the data and print the data and view display the data and manages the user interaction with it. Notepad is simple example for SDI application. or ALL MFC application which have user interface follow this architecture. Any MFC application creates with two basic skeleton one is document class and another is view class.document manages the data for multiple view,and view class displays the data. MFC document/view architecture makes it easy to support multiple view,multiple document types, splitter windows and other valuable user interface features. . For exm:- in SDI application we have following major class:- 1. CMainFrameApp:- Frame class derived  from the CFrameWnd 2. CMySDIView :- View class derived  from the CView class 3. CMainDoc :- Document class derived  from the CDoc...