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

    Pergunta

  • 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
    sábado, 28 de maio de 2005 13:52

Respostas

  • 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/
    sábado, 28 de maio de 2005 07:02
  • A solution if it is a UNICODE build:

    Put

    wWinMainCRTStartup

     

    as entry point in the linker properties.

    segunda-feira, 6 de março de 2006 14:44

Todas as Respostas

  • 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/
    sábado, 28 de maio de 2005 07:02
  •  

    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!!!!

    segunda-feira, 6 de março de 2006 13:24
  • A solution if it is a UNICODE build:

    Put

    wWinMainCRTStartup

     

    as entry point in the linker properties.

    segunda-feira, 6 de março de 2006 14:44
  • 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

    quarta-feira, 5 de abril de 2006 00:50
  • 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?

     

     

     

    segunda-feira, 24 de abril de 2006 03:14
  • 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.

     

    • Sugerido como Resposta Angusto sexta-feira, 16 de outubro de 2009 23:26
    quarta-feira, 10 de maio de 2006 07:41
  • 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 :)

    quinta-feira, 15 de junho de 2006 13:59
  • I found I had to set the subsystem to notset??

    -Al

     

    sexta-feira, 23 de junho de 2006 10:07
  • 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.

    sexta-feira, 23 de junho de 2006 11:20
    Moderador
  • 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

    sábado, 12 de agosto de 2006 12:33
  • 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.

    domingo, 13 de agosto de 2006 21:08
    Moderador
  • 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

    sexta-feira, 18 de agosto de 2006 05:14
  • Hello farang,

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

    sexta-feira, 18 de agosto de 2006 19:41
    Moderador
  • 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 ==========

    sexta-feira, 1 de setembro de 2006 18:44

  • 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)

    sexta-feira, 22 de setembro de 2006 03:26

  • 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!
    sexta-feira, 22 de setembro de 2006 03:41
  •  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?
    terça-feira, 26 de setembro de 2006 06:21
  • 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()".
    terça-feira, 26 de setembro de 2006 08:50
  • 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>


     

    terça-feira, 3 de outubro de 2006 10:53
  • 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.

    segunda-feira, 9 de outubro de 2006 02:55
  • 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?

    quarta-feira, 11 de outubro de 2006 03:14
  •  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?
    quarta-feira, 11 de outubro de 2006 03:20
  •  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.
    quarta-feira, 11 de outubro de 2006 03:23
  •  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.

    quarta-feira, 11 de outubro de 2006 03:36
  • 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.

    terça-feira, 14 de novembro de 2006 21:13
  • 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),
    quinta-feira, 16 de novembro de 2006 17:15
  •  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.
    quinta-feira, 16 de novembro de 2006 18:21
  •  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.

    quinta-feira, 16 de novembro de 2006 18:51
  • 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?
    domingo, 26 de novembro de 2006 10:57
  • 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.

    domingo, 26 de novembro de 2006 18:53
  • Thanks for the headsup.  It took about two minutes to locate a make changes.  Unfortunetly my students would never have located the change.
    quarta-feira, 21 de março de 2007 02:38
  • 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.


     

    terça-feira, 27 de março de 2007 14:06
  • Your problem is not the same and therefore the solution is likely different. You should create a new question (thread).
    quarta-feira, 28 de março de 2007 03:17
  • 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



    segunda-feira, 30 de julho de 2007 03:40
  • Thanks Todd. Your solution helped me get started with Visual C++ 2008.

    quinta-feira, 3 de janeiro de 2008 13:10
  •  

    thanx chaning the subsytem to console works for me...
    quarta-feira, 7 de maio de 2008 10:56
  • 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.

     

    segunda-feira, 26 de maio de 2008 05:01
  • 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
    }

    sexta-feira, 30 de maio de 2008 02:43
  • yes ,it really can solva the problem .Thank you
    domingo, 13 de julho de 2008 12:00
  • 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!
    terça-feira, 21 de outubro de 2008 16:10
  • 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
    terça-feira, 30 de dezembro de 2008 09:36
  • 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
    sábado, 24 de janeiro de 2009 11:53

  • 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.
    terça-feira, 19 de maio de 2009 15:20
  • 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.....


    sexta-feira, 18 de setembro de 2009 09:02
  • Thanks Dude. its Working.
    segunda-feira, 10 de maio de 2010 17:24
  • try add

    #include

     

    <stdio.h>

    segunda-feira, 10 de maio de 2010 18:03
  • 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!
    terça-feira, 11 de maio de 2010 04:31
    Moderador