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

Author Topic: various problems in VS2010 doing the 1st tutorial  (Read 2531 times)

0 Members and 1 Guest are viewing this topic.

zsero

  • Newbie
  • *
  • Posts: 1
    • View Profile
various problems in VS2010 doing the 1st tutorial
« on: November 24, 2010, 05:25:07 am »
I am just trying to do the very first tutorial and I have spent half a night figuring out how to make it work under VS2010, but with no success.

In 1.6 I have to use the release dll, the debug doesn't work. Both in dynamic and static linkings.

In 1.7 the build process couldn't finish, it had 17 projects with errors.

In 2.0 dynamic linking works, static doesn't.

Here are my detailed findings:

dynamic 1.6 (SFML_DYNAMIC):
Debug - sfml-system.lib - OK
Debug - sfml-system-d.lib - The application was unable to start correctly (0xc01500002)...
Release - sfml-system.lib - OK
Release - sfml-system-d.lib - The application was unable to start correctly (0xc01500002)...

static 1.6:
Debug - sfml-system-s.lib - The application was unable to start correctly (0xc01500002)...
Debug - sfml-system-s-d.lib - The application was unable to start correctly (0xc01500002)...

1.7: cannot complete build in VS2010


2.0 dynamic: sfml-system-d.lib - OK
2.0 static: sfml-system-s-d.lib: link error:
Code: [Select]
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl sf::Sleep(float)" (__imp_?Sleep@sf@@YAXM@Z) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall sf::Clock::GetElapsedTime(void)const " (__imp_?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Clock::Clock(void)" (__imp_??0Clock@sf@@QAE@XZ) referenced in function _main



I am a beginner, but can you tell me what am I doing wrong? What should I use with VS2010, version 2.0 or 1.6?

Moreover for the OpenGL tutorial, I found _no way_ to make it compile. Neither under 2.0 or under 1.6. It's full of linker error. I think it's looking for the opengl header, but it couldn't find it.
Code: [Select]
1>test.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glVertex3f@12 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall sf::Clock::GetElapsedTime(void)const " (__imp_?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glDepthMask@4 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Clock::Clock(void)" (__imp_??0Clock@sf@@QAE@XZ) referenced in function _main

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
various problems in VS2010 doing the 1st tutorial
« Reply #1 on: November 24, 2010, 08:13:11 am »
Quote
In 1.6 I have to use the release dll, the debug doesn't work. Both in dynamic and static linkings.

Have you recompiled SFML with VC++ 2010?

Quote
In 1.7 the build process couldn't finish, it had 17 projects with errors.

What errors did you get?

Quote
In 2.0 dynamic linking works, static doesn't.

For static link in SFML 2, you need to define SFML_STATIC (before it was SFML_DYNAMIC for using dynamic libs).

Quote
I am a beginner, but can you tell me what am I doing wrong? What should I use with VS2010, version 2.0 or 1.6?

Both should work, if you recompiled them properly.

Quote
Moreover for the OpenGL tutorial, I found _no way_ to make it compile. Neither under 2.0 or under 1.6. It's full of linker error. I think it's looking for the opengl header, but it couldn't find it.

Not the OpenGL header, but the OpenGL library (link to opengl32.lib, and maybe glu32.lib as well). "Unresolved external" errors are always refering to the linker (ie. the compiler succeeded), and usually mean that you forgot to link to a library you're using.
Laurent Gomila - SFML developer