locked
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

    Question

  • Hi,
    i am completely new to this and have to learn the language fairly rapidly, got myself a decent book, but when i try and compile a simple hello world program i get the error:
        Linking...
       MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
       Debug\dont know.exe : fatal error LNK1120: 1 unresolved externals
       Build log was saved at "file://c:\Documents and Settings\Justin Pyfrom\My Documents\Visual Studio 2005\Projects\dont know\dont know\Debug\BuildLog.htm"
    dont know - 2 error(s), 0 warning(s)

    the hello world code is in a .cpp file format and the code is:
          #include <iostream>
    int main()
    {
    std::cout <<
    "Hello World|n";
    return (0);
    }

    Any help would be very much appreciated
    Thanks
    JustinPyfrom@hotmail.com
    Saturday, May 28, 2005 1:52 PM

Answers

  • Hi Justin!
    i am completely new to this and have to learn the language fairly rapidly, got myself a decent book, but when i try and compile a simple hello world program i get the error:
        Linking...
       MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
       Debug\dont know.exe : fatal error LNK1120: 1 unresolved externals
       Build log was saved at "file://c:\Documents and Settings\Justin Pyfrom\My Documents\Visual Studio 2005\Projects\dont know\dont know\Debug\BuildLog.htm"
    dont know - 2 error(s), 0 warning(s)

    the hello world code is in a .cpp file format and the code is:
          #include <iostream>
    int main()
    {
    std::cout <<
    "Hello World|n";
    return (0);
    }

    Please change the "subsystem" in your linker settings from "Windows" to "Console".
    -- 
    Greetings
      Jochen
     
       My blog about Win32 and .NET
       http://blog.kalmbachnet.de/
    Saturday, May 28, 2005 7:02 AM
  • A solution if it is a UNICODE build:

    Put

    wWinMainCRTStartup

     

    as entry point in the linker properties.

    Monday, March 6, 2006 2:44 PM

All replies

  • Hi Justin!
    i am completely new to this and have to learn the language fairly rapidly, got myself a decent book, but when i try and compile a simple hello world program i get the error:
        Linking...
       MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
       Debug\dont know.exe : fatal error LNK1120: 1 unresolved externals
       Build log was saved at "file://c:\Documents and Settings\Justin Pyfrom\My Documents\Visual Studio 2005\Projects\dont know\dont know\Debug\BuildLog.htm"
    dont know - 2 error(s), 0 warning(s)

    the hello world code is in a .cpp file format and the code is:
          #include <iostream>
    int main()
    {
    std::cout <<
    "Hello World|n";
    return (0);
    }

    Please change the "subsystem" in your linker settings from "Windows" to "Console".
    -- 
    Greetings
      Jochen
     
       My blog about Win32 and .NET
       http://blog.kalmbachnet.de/
    Saturday, May 28, 2005 7:02 AM
  •  

    I obtained the same error. If you change "subsystem" in your linker settings from "Windows" to "Console" then you obtain the error:

    msvcrtd.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

     

    So, it is not a solution!!!!

    Monday, March 6, 2006 1:24 PM
  • A solution if it is a UNICODE build:

    Put

    wWinMainCRTStartup

     

    as entry point in the linker properties.

    Monday, March 6, 2006 2:44 PM
  • I actually had to do the opposite.  I had to set the linker to "Windows"  It fixed my problem. 

    I am using Visual Studio 2005, which does not have a lot of documentation out yet, so I will describe how to do this. 

    Right click on the Project name in the "Solution Explorer"  (Gag)
    Select Properties
    Open Linker in Configuration Properties
    Subsystem will be the first item on the list.  Select "Windows (/SUBSYSTEM:WINDOWS)" on the dropdown

    Todd

    Wednesday, April 5, 2006 12:50 AM
  • Im having a similiar problem, but...

     

    In this respect, Im using VS 2005, tryin to run the compiled app ... It compiles after I convert to Console.

    But when I dbl clik, It fails. But the app does require arguments, would this be a problem cause?

     

     

     

    Monday, April 24, 2006 3:14 AM
  • The Visual Studio Hello World main and WinMain ILLUSION

    IT JUST WORKS OR DOES IT?

    Yes it does, just solve the ILLUSION.
    If you have been writing C++ for years you will realise that Microsoft C++ compiler and linker Error Messages are 5 times worse than GNU C++.  Nice programming environment and very good .NET framework ideas do not make up for the bad unintelligent terse OUT OF CONTEXT error messages. This is a case in point:

    Explanation of the ILLUSION.

    int main(int argc, char *argv[])   You probably need to set Project->properties->linker->system->subsystem    to CONSOLE

    If you have an INCOMPATIBLE NON STANDARD C++ main; breaking all the standards in the book; such as the Microsoft veriety then set the same subsystem property to WINDOWS

    THE ERRORs if you SET subsystem to CONSOLE is:

    MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

    OR THE ERROR if you SET subsystem to WINDOWS is:

    MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

    The error means you do not have the main visible to the the linker. But you are editing the file with main or WinMain  in the VS Editor, so what is wrong?

    Visual Studio can be used as a stand alone editor giving you the illusion that the stuff you are editing can and should be compilable.  So the solution is simple you failed to add the file you are editing to the project.  

    Right click on solution name->Add->Existing Item->file with main

    Ctl-shift-B and it compiles Hello World.

    SOLVED BUT MICROSOFT NEED TO ADD AN INTELLIGENT LOOK AND SEE WHAT THE DEVELOPER HAS IN HIS EDIT SCREENs.  USER CONTEXT IS VITAL FOR SMART ERROR MESSAGES - TOTALLY ABSENT IS ANY SMART ERROR MESSAGE IN THE OUTPUT FROM THE COMPILER AND LINKER.

     

    • Proposed as answer by Angusto Friday, October 16, 2009 11:26 PM
    Wednesday, May 10, 2006 7:41 AM
  • Bao Baboon

    You are awesome, thanks for pointing that out.  I clicked and dragged one file from one project into another, and I couldn't figure out why I was getting that error.  Your solution fixed it :)

    Thursday, June 15, 2006 1:59 PM
  • I found I had to set the subsystem to notset??

    -Al

     

    Friday, June 23, 2006 10:07 AM
  • For these types of errors, it's easier to just start all over again, choose the right type of project from the New Project Wizard and copy your old code into there.

    eg. if you're going to use .NET, make sure you choose a CLR project. If you're going to use MFC, make sure you choose an MFC project.

    Friday, June 23, 2006 11:20 AM
    Moderator
  • Hello, sounds like you know what you're talking about. but can you explain this lke you were talking to a baby.

    Am using VS 6.0 and am programming a game, starting with the registering and creating of a window. haven't got a clue what to do, basically have got this far

    #include <windows.h>

    ?

    am speed learning this subject but the code i've been experimenting with brings up that error

    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/try3.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    Didn't et what you said in your solution above. can you help me?thanks

    Saturday, August 12, 2006 12:33 PM
  • Trekforcode.

    The linker error is caused by your source lacking a main(). Having just one line which says #include <windows.h>, is not enough to get a program to build.

    All windows C++ applications must define a function which will be designated as the entry point. By default, it is called main and looks like the function that JustinPyfrom wrote. Without this main function, your program does nothing, and VC++ will not build it. If you copy the code that JustinPyfrom wrote and put it into yours, I think you'll find that your build errors will be eliminated.

    If you're completely starting out with C++ (and not just Windows programming), I'd advise against trying to learn Windows Programming simultaneously with C++. Start off programming with standard C++ (ie. command prompt apps) first of all, become an expert in that language, then move onto Windows programming.

    Sunday, August 13, 2006 9:08 PM
    Moderator
  • I have a quite similar problem but couldn't find the answer in previous posts. My error says:

    Linking...
    lib file aanroepen.obj : error LNK2019: unresolved external symbol "public: void __thiscall CSoundManager::isplaying(int)" (?isplaying@CSoundManager@@QAEXH@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
    Debug/lib file aanroepen.exe : fatal error LNK1120: 1 unresolved externals

    Visual Studio Projects\lib file aanroepen\Debug\BuildLog.htm"
    lib file aanroepen - 2 error(s), 0 warning(s)


    This is only since I tried to add a function to my code and call that function. Can anyone guide me out here? Thanks sincerely

    Friday, August 18, 2006 5:14 AM
  • Hello farang,

    What is CSoundManager? Can we see the definition of that class and/or the source code to it?

    Friday, August 18, 2006 7:41 PM
    Moderator
  • doesn't work.

    i've enclosed the main.cpp into my project and i'm sure i'm using the /subsystem:console, but i still got the error:

    ------ Build started: Project: CEGUI, Configuration: Debug Win32 ------
    Linking...
    MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    C:\Documents and Settings\billconan\桌面\CEGUI\Debug\CEGUI.exe : fatal error LNK1120: 1 unresolved externals
    Build log was saved at "file://c:\Documents and Settings\billconan\桌面\CEGUI\CEGUI\Debug\BuildLog.htm"
    CEGUI - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Friday, September 1, 2006 6:44 PM

  • I am having the same problem as billconan.  I have an older, Academic version of Visual Studio .NET 2003.  It has VC++ 7.1 I believe.

    I have fought tooth and nail for three days to come to this unresolvable linker error:

    ------ Build started: Project: ZombieP, Configuration: Release Win32 ------

    Linking...
    LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
    Release/ZombieP.exe : fatal error LNK1120: 1 unresolved externals

    Build log was saved at "file://c:\Code\Microsoft Studio Projects\ZombieP\Release\BuildLog.htm"
    ZombieP - 2 error(s), 0 warning(s)

    ---------------------- Done ----------------------

        Build: 0 succeeded, 1 failed, 0 skipped


    I have a main.cpp file in the Source files directory under project ZombieP.  It has a main() function.  It is as follows: 

    int main()
    {
       try {
          GameManager man = GameManager();
         // cout << "got here" << endl;
          man.animate();
       }
       catch (const string& msg) { /* cout << msg << endl; */ }
       catch (...) {
          //cout << "Oops, someone threw an exception!" << endl;
       }
       return(0);

    } //main 

    I have tried to make it a _main() function.  My project is a console project by default and I have played with the System properties under the linker in several configurations.  At present it is set to Console.  Minimize CRT use in ATL is set to No.  I have tried using mainCRTStartup and wmainCRTStartup as defined entry points in linker.  I have tried ignoring LIBCMT.lib (mostly because I'm a greenie and don't know what I'm doing).  I got several hundred linker errors from that stunt. 

    I have, in short, read and tried everything I could find on the internet that I could understand (some suggestions were very ambiguous and clearly meant for those with extensive prior experience with Visual Studio).  I am losing sleep over this stupid error.  Any suggestions?

    (PS, the couts are commented out because I was getting a linker error involving ostreams.  This was the only solution that seemed to work)

    Friday, September 22, 2006 3:26 AM

  • Wow, seems almost the moment I got frustrated and posted here I found my answer.  I was missing a .lib file (SDLmain.lib for those curious in the future).  Sorry to clutter up the board!
    Friday, September 22, 2006 3:41 AM
  •  billconan wrote:
    doesn't work.

    i've enclosed the main.cpp into my project and i'm sure i'm using the /subsystem:console, but i still got the error:

    ------ Build started: Project: CEGUI, Configuration: Debug Win32 ------
    Linking...
    MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
    C:\Documents and Settings\billconan\桌面\CEGUI\Debug\CEGUI.exe : fatal error LNK1120: 1 unresolved externals
    Build log was saved at "file://c:\Documents and Settings\billconan\桌面\CEGUI\CEGUI\Debug\BuildLog.htm"
    CEGUI - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



    Did anyone ever solve billconan's post? His error was slightly different (had tmainCRTStartup as part of the error instead of the others mentioned). I am now getting the same error in Visual C++ 2005 Express Edition. Any help?
    Tuesday, September 26, 2006 6:21 AM
  • The solution was simple, when compiling a Win32 Windows Application, use
    "int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)" instead of "int main()".
    Tuesday, September 26, 2006 8:50 AM
  • Friends I am using Visual Studio 6.0 and i got this error

    msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main

    Debug/HelloApp.exe : fatal error LNK1120: 1 unresolved externals

    can any body help me in this matter why it is coming and how to rectify it

    i have written a basic Windows program

    HelloWnd.cpp:

    #include "HelloWnd.h"

    IMPLEMENT_SERIAL(CHelloWnd,CFrameWnd,0)

    BEGIN_MESSAGE_MAP(CHelloWnd,CFrameWnd)
    ON_WM_LBUTTONDOWN()
    ON_WM_RBUTTONDOWN()
    ON_WM_PAINT ()
    END_MESSAGE_MAP()

    void CHelloWnd::OnLButtonDown(UINT nFlags,CPoint pt)
    {
     AfxMessageBox("Hai Rajesh");
     CFrameWnd::OnLButtonDown(nFlags,pt);
    }

    void CHelloWnd::OnRButtonDown(UINT nFlags1,CPoint pt1)
    {
     AfxMessageBox("Good Morning");
     CFrameWnd::OnRButtonDown(nFlags1,pt1);
    }
    void CHelloWnd::OnPaint ()
    {
        CPaintDC dc (this);
       
        CRect rect;
        GetClientRect (&rect);

        dc.DrawText (_T ("Hello, MFC"), -1, &rect, DT_CENTER);

    HelloWnd.h:

    #include "stdafx.h"

    class CHelloWnd : public CFrameWnd
    {
    public:
     CHelloWnd()
     {
      Create(NULL,"My First MFC Application");
     }

     void OnLButtonDown(UINT,CPoint);
     void OnRButtonDown(UINT,CPoint);
     afx_msg void OnPaint ();

     DECLARE_SERIAL(CHelloWnd)

     DECLARE_MESSAGE_MAP()
    };


    HelloApp.h

    #include "stdafx.h"

    class CHelloApp : public CWinApp
    {
    public:
     virtual BOOL InitInstance();

    DECLARE_DYNAMIC(CHelloApp)
    };

    HelloApp.cpp

    #include "Helloapp.h"
    #include "HelloWnd.h"

    IMPLEMENT_DYNAMIC(CHelloApp,CWinApp)

    BOOL CHelloApp::InitInstance()
    {
     m_pMainWnd = new CHelloWnd();
     m_pMainWnd->ShowWindow(SW_SHOW);
     m_pMainWnd->UpdateWindow();
     return TRUE;
    }

    CHelloApp theApp;

    stdafx.h

    #include<afxwin.h>


     

    Tuesday, October 3, 2006 10:53 AM
  • I am having the same problems as described, I have tried all solutions presented also, here is my code that I am tryin to work with.


    #include <stdio.h>

    int Count (float A[], int Size, float X)

    {  

        if ( Size <=0)  

    {       

    return 0;   

    }  

    else         return(A[0] ==X) + Count(A+1, Size-1,X);

    }

    Strange thing is I have tried other programs and get the same errors.  Some of the programs that I write work perfectly and others like this one do not i am using VS2005 Academic Edition.  I can compile with no problems but cannot build.

    Monday, October 9, 2006 2:55 AM
  • It should be very easy, unless I missed something.

    I created a new project using File | New | Project | Win32 | Win32 Console Application. Then I entered a name for the project and  unchecked "Create directory for solution". For the Application Settings page, I checked "Empty Project".

    After creating the project, I created the cpp file and added it to the project. Then I pressed the F7 key to build the program and that did it. The program was ready for execution.

    Or did I miss something more that is a requirement?

    Wednesday, October 11, 2006 3:14 AM
  •  NNTP User wrote:
    Please change the "subsystem" in your linker settings from "Windows" to "Console".
    In VC 6 it was very difficult to change a Windows project to a console project or a console project to a Windows project. Is it truly that easy for VC 2005?
    Wednesday, October 11, 2006 3:20 AM
  •  sdiaconescu2001 wrote:

    A solution if it is a UNICODE build:

    Put

    wWinMainCRTStartup

     

    as entry point in the linker properties.

    Not for a console project; look in the documentation.
    Wednesday, October 11, 2006 3:23 AM
  •  Bao Baboon wrote:
    int main(int argc, char *argv[])   You probably need to set Project->properties->linker->system->subsystem    to CONSOLE
    Yes, the subsystem must be console for a console program but I think it is unlikeluy that that is the only change necessary to convert a non-console project to be a console project.

     Bao Baboon wrote:
    If you have an INCOMPATIBLE NON STANDARD C++ main; breaking all the standards in the book; such as the Microsoft veriety then set the same subsystem property to WINDOWS
    Huh? If it is messed up then Windows will choke too.

     Bao Baboon wrote:
    THE ERRORs if you SET subsystem to CONSOLE is:

    MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

    Yes, but only if it is a Windows program that you set the susbsytem to console for.

    Wednesday, October 11, 2006 3:36 AM
  • I am using 2005 VC++ express

    I had the same challenge but the none of the above posts worked. You can try this;

     

    Go to ; project > add existing item > , in the menu go to the directory that the  .cpp of your function is located and select it. (try bulding)

     

    Worked for me.

    Tuesday, November 14, 2006 9:13 PM
  • I'm also using VS2005, but I fixed it through Project Properties -> Configuration Properties -> Linker -> System -> Subsystem   and changed the value to 'Windows'  (I originally created a console application),
    Thursday, November 16, 2006 5:15 PM
  •  farang wrote:
    I have a quite similar problem but couldn't find the answer in previous posts. My error says:

    Linking...
    lib file aanroepen.obj : error LNK2019: unresolved external symbol "public: void __thiscall CSoundManager::isplaying(int)" (?isplaying@CSoundManager@@QAEXH@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
    Debug/lib file aanroepen.exe : fatal error LNK1120: 1 unresolved externals

    Visual Studio Projects\lib file aanroepen\Debug\BuildLog.htm"
    lib file aanroepen - 2 error(s), 0 warning(s)


    This is only since I tried to add a function to my code and call that function. Can anyone guide me out here? Thanks sincerely

    I think it would have been better to create a new thread for your question. I think you would get more help about your problem specifically. This thread is gettting big. Your problem is not the same as the original one and the answer is not the same.
    Thursday, November 16, 2006 6:21 PM
  •  RajeshBabu wrote:

    Friends I am using Visual Studio 6.0 and i got this error

    msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main

    Debug/HelloApp.exe : fatal error LNK1120: 1 unresolved externals

    can any body help me in this matter why it is coming and how to rectify it

    i have written a basic Windows program

    I doubt that you wrote that program. It is a MFC program, not a basic Windows program. It must be a sample program you got from someplace. You might have modified it, but you did not write it.

    Is that a class project? If so, then the instructor should tell you how to compile it.

    If you got the sample from a book, then the book tells you how to compile it. I think however that the book is not a good book, since MFC projects are now started by generating the initial MFC source code with a project that is ready to be compiled properly.

    You should create a new thread with this question. Note however that people that answer questions are reluctant to provide detailed answers when a person asks a question about a class project that they should be able to answer themselves. Also, when you ask about this, don't say it is a basic Windows program.

    You should find a book or other tutorial that teaches MFC and that teaches how to generate projects; all modern books and tutorials would.

    Thursday, November 16, 2006 6:51 PM
  • I'm using VS2005 and I did exactly as Sam Hobbs described, but I still get those "unresolved external symbol" errors from the linker. The source code file I added to the "Empty Project" was main.cpp from http://www.netchain.com/netcps/NetCPS.zip.

    error LNK2001: unresolved external symbol _accept@12

    And 14 more. What am I doing wrong?
    Sunday, November 26, 2006 10:57 AM
  • Jonny, your problem is very different . The error messages are the same, but that is the only similarity. More specificly, the unresolved symbols such as _accept@12 are different.

    You should create a new thread (a new question). That source code was not written for a beginner; it assumes you are familiar with network programming. Please ask in a new thread what you need to do.

    Sunday, November 26, 2006 6:53 PM
  • Thanks for the headsup.  It took about two minutes to locate a make changes.  Unfortunetly my students would never have located the change.
    Wednesday, March 21, 2007 2:38 AM
  • Hi, I have a same error:

     

    error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _wmain Server.obj

     

    I have a client server socket connetction program. In the client I resolv this problem add the winsock.lib in my project. For the server I don't have a winsock.lib, but a DLL; I add it in my project but I don't resolv nothing.

     

    I follow the  previous step but don't work.


     

    Tuesday, March 27, 2007 2:06 PM
  • Your problem is not the same and therefore the solution is likely different. You should create a new question (thread).
    Wednesday, March 28, 2007 3:17 AM
  • Just posting this in case someone does not find your solution helpful.

    I also got:

    "unresolved external symbol _main referenced in function ___tmainCRTStartup"

    and setting the linker settings of my project to /subsystem:windows did not help.

    The reason was:
    Someone had put:

    #pragma comment(linker,"/subsystem:console")

    deep into the nesting hierarchy of my include files. In fact, the include file in question belonged to a third-party library.

    Moreover, it was possible to build the sources compiled with the #pragma comment(linker,"/subsystem:console") into a library, and this library could be linked into a windows program with /subsystem:windows. But the program had this annoying windows console come up each time when running.


    Taking this #pragma out solved both problems.

    HTH someone somewhere,

    Eure Uebersetzerin



    Monday, July 30, 2007 3:40 AM
  • Thanks Todd. Your solution helped me get started with Visual C++ 2008.

    Thursday, January 3, 2008 1:10 PM
  •  

    thanx chaning the subsytem to console works for me...
    Wednesday, May 7, 2008 10:56 AM
  • Flat out no matter what I put in for subsystem I never get an exe built and it fails to run.

    Linking fails as well.

    Build sure, no sweat says its built no errors, never did anything just spits out what appears to be nonsense.

     

    Monday, May 26, 2008 5:01 AM
  • Hello im new to C++ and want to know how to compile this Program

    #include <iostream.h>
    #include <stdio.h>
    int main()
    {
    int Answer;
    cout <<
    "How Many video games do you have?";
    cin >> Answer;
    If (Answer<= 10);
    cout <<
    "You need more Video Games!";
    }
    Else
    {
    cout <<
    "Awesome you got a lot of video games!!"
    getchar()
    return 0
    }

    Friday, May 30, 2008 2:43 AM
  • yes ,it really can solva the problem .Thank you
    Sunday, July 13, 2008 12:00 PM
  • sdiaconescu2001 said:

    A solution if it is a UNICODE build:

    Put

    wWinMainCRTStartup

     

    as entry point in the linker properties.



    I had to convert my project to unicode, i.e. add _UNICODE to the preprocessor flags, and changing the entry point to wWinMainCRTStartup solved my linker error.  Thank you for the tip!
    Tuesday, October 21, 2008 4:10 PM
  • Dear MigrationUser1,

    Thank you so much! You are absolutley right as I encountered this same eror. I initially 
    thought the compiler needed additonal settings because I was trying to used the string library,
    but thanks for pointing out that I needed to change it my subsystem from window to console!

    I love learing stuff about the IDE and about C++! I am elated!

    Thank you

    MrBCut
    Tuesday, December 30, 2008 9:36 AM
  • Hi, nothing above worked for me, the problem is that winmain cannot be found and that is entry point in linker options! Putting wWinMainCRTStartup caused another error, so i change that to this WinMainCRTStartup and finally it worked!
    student
    Saturday, January 24, 2009 11:53 AM

  • Wow, seems almost the moment I got frustrated and posted here I found my answer.  I was missing a .lib file (SDLmain.lib for those curious in the future).  Sorry to clutter up the board!
    thanks for the tip, it works for me.
    Tuesday, May 19, 2009 3:20 PM
  • Dear,

    just find the project setting, i think you changed it before.

    Set [Runtime Library] to Mutil-Threaded DLL.
    this usually changes when you set USE of MFC etc.....


    Friday, September 18, 2009 9:02 AM
  • Thanks Dude. its Working.
    Monday, May 10, 2010 5:24 PM
  • try add

    #include

     

    <stdio.h>

    Monday, May 10, 2010 6:03 PM
  • I'm going to lock this thread.  The original question was answered long ago, and this thread has accumulated parts of various other questions and answers so additional posts to this thread don't appear helpful. 

    If you encounter a similar problem that's not already adequately answered by this thread, please post your question in a new thread.


    -cd [VC++ MVP] Mark the best replies as answers!
    Tuesday, May 11, 2010 4:31 AM
    Moderator