Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Setup for SMFL 2.0  (Read 1270 times)

0 Members and 1 Guest are viewing this topic.

Amorie

  • Newbie
  • *
  • Posts: 2
    • View Profile
Setup for SMFL 2.0
« on: December 08, 2012, 09:10:26 pm »
I just started learning C++ about a month ago. Mostly only done console stuff and a little directX from a youtube series but used a premade framework for that.

So followed the SMFL tutorial to setup the compiler. Im using Visual Studio 2010 express.

Put in some code and It wont compile. Been searching for about 2 hours now and cant find a resolution.
Any help would be appreciated. (set it up to use Static .dll)

1>------ Build started: Project: wtf, Configuration: Debug Win32 ------
1>  main.cpp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>c:\users\amorie\documents\visual studio 2010\Projects\wtf\Debug\wtf.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The code im trying to compile:
#include <SFML/Graphics.hpp>



int main()
{
        sf::RenderWindow window(sf::VideoMode( 200, 200 ), "SFML works!" );
        sf::CircleShape shape( 100.f);
        shape.setFillColor( sf::Color::Green );

        while ( window.isOpen() )
        {
                sf::Event event;
                while( window.pollEvent( event ) )
                {
                        if(event.type == sf::Event::Closed )
                                window.close();
                }

                window.clear();
                window.draw(shape);
                window.display();
        }
        return 0;
}
Libraries added for debug:
sfml-graphics-s-d.lib
sfml-audio-s-d.lib
sfml-system-s-d.lib
sfml-window-s-d.lib
sfml-network-s-d.lib

Libraries added for release:
sfml-graphics-s.lib
sfml-audio-s.lib
sfml-system-s.lib
sfml-window-s.lib
sfml-network-s.lib

All config - Preproccessor:
SFML_STATIC

All config:
include directory
library directory

I followed the official tutorial and watched some videos and double checked everything. Started a clean project and did it again and still the same results.

Thanks for any help,
Amorie

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Setup for SMFL 2.0
« Reply #1 on: December 08, 2012, 09:28:36 pm »
Did you chose win32 console application when creating your project in wizard?
Back to C++ gamedev with SFML in May 2023

Amorie

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Setup for SMFL 2.0
« Reply #2 on: December 08, 2012, 09:35:15 pm »
I got it to work finally. I created a Win32 Project.  To get  it working I just created an empty project went back through all the setup.

 

anything