Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:14:53+00:00 2026-06-13T04:14:53+00:00

I was able to get tutorial #1 to compile fine. But I can’t get

  • 0

I was able to get tutorial #1 to compile fine. But I can’t get the 2nd one to compile.

When you do new -> Project, maybe one of those settings are interfering? Pretty sure I did empty project, else console.

What’s wrong?
compile error:

Error   1   error LNK2019: unresolved external symbol _WinMain@16 referenced in function
___tmainCRTStartup  C:\...\02-videomode-iterate\MSVCRTD.lib(crtexew.obj)    02-videomode-iterate
Error   2   error LNK1120: 1 unresolved externals   C:\...\Debug\02-videomode-iterate.exe   02-videomode-iterate

entire source:

#include <SFML/Window.hpp>

int main()
{
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML-tut: 02");

    bool Running = true;
    while (Running)
    {
        App.Display();
    }

    return EXIT_SUCCESS;
}

Project settings:

include dir, lib: dir set correctly.

c++ -> preprocessor -> preprocessor definitions:

SFML_DYNAMIC

linker -> input

tried: sfml-window.lib and sfml-window-d.lib ( visual studio seems to always use debug mode at start? but tutorial #1 only worked when I didn’t use -d version.

subsystem:

/SUBSYSTEM:WINDOWS

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:14:54+00:00Added an answer on June 13, 2026 at 4:14 am

    When you set the /SUBSYSTEM:WINDOWS flag, the linker will look for a WinMain function rather than the conventional main. You have two options:

    1. Change to /SUBSYSTEM:CONSOLE. You will get an annoying (or perhaps helpful) console window, which you can get rid of with FreeConsole.
    2. Change main to WinMain with the following signature:

      int CALLBACK WinMain(
       HINSTANCE hInstance,
       HINSTANCE hPrevInstance,
       LPSTR lpCmdLine,
       int nCmdShow
      );
      

      Unless you need to access argc and argv, this change shouldn’t cause too much trouble.


    Edit: Perhaps this is worth a look too (copied from the second tutorial):

    Under Windows operating systems, you may have created a “Windows
    Application” project, especially if don’t want the console to show up.
    In such case, to avoid replacing main by WinMain, you can link with
    SFML_Main static library and keep a standard and portable main entry
    point.

    So, I suppose that boils down to adding sfml-main.lib (or similar) to the list of libraries to link with.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

not able to get this, can someone help for this LINQ query? select col1,
I am able to get the current date, but I don't know how to
I was able to get oauth token from FourSquare by following a tutorial given
I'm following this tutorial: http://www.vogella.com/articles/RSSFeed/article.html It works great and i'm able to get all
I'm following the Heroku scala tutorial at https://devcenter.heroku.com/articles/scala I was able to get everything
I am not able to get the hg head or status for a given
I am able to get the output of a pdf using fpdf, the problem
I'm not able to get this persistence file correct... I do not find any
I am able to get the current page's url in jsf from back-end bean
I'm able to get the following results with this working query: $query = SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.