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

Author Topic: Errors while linking  (Read 5238 times)

0 Members and 1 Guest are viewing this topic.

totalwar235

  • Newbie
  • *
  • Posts: 11
    • View Profile
Errors while linking
« on: January 23, 2011, 10:57:04 pm »
i am brand new to this SDK and i just tried compiling the test code from the tutorial that uses the clock.

when i compiled it i received 4 errors.  every single error was  LNK2019.

i followed the installation instructions perfectly.

i am using the Visual C++ 2008 to compile and i am running it on a windows XP, 32 bit.

any way to fix this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Errors while linking
« Reply #1 on: January 23, 2011, 11:10:35 pm »
Quote
every single error was LNK2019

We're not compilers, it's easier to understand with the message than with the code... ;)
Laurent Gomila - SFML developer

totalwar235

  • Newbie
  • *
  • Posts: 11
    • View Profile
Errors while linking
« Reply #2 on: January 23, 2011, 11:17:38 pm »
this is everything i got after compiling.


------ Build started: Project: SFML_Test, Configuration: Debug Win32 ------
Compiling...
Main.cpp
Linking...
Main.obj : error LNK2019: unresolved external symbol "void __cdecl sf::Sleep(float)" (?Sleep@sf@@YAXM@Z) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function _main
Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) referenced in function _main
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\Documents and Settings\Owner\My Documents\Visual Studio 2008\Projects\SFML_Test\Debug\SFML_Test.exe : fatal error LNK1120: 4 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2008\Projects\SFML_Test\SFML_Test\Debug\BuildLog.htm"
SFML_Test - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Errors while linking
« Reply #3 on: January 24, 2011, 12:14:49 am »
Looks like you didn't link to SFML (or at least parts of it). What are your linker settings for each configuration?

In SFML 1, you also have to define the macro SFML_DYNAMIC when linking dynamically.
In SFML 2, it's just converse (SFML_STATIC for static linking required).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

totalwar235

  • Newbie
  • *
  • Posts: 11
    • View Profile
Errors while linking
« Reply #4 on: January 24, 2011, 12:57:48 am »
i am using SFML 1.6 and i did link something incorrectly. i fixed it and i got a new error. this is what came up.


------ Build started: Project: SFML_Test, Configuration: Debug Win32 ------
Compiling...
Main.cpp
Linking...
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\Documents and Settings\Owner\My Documents\Visual Studio 2008\Projects\SFML_Test\Debug\SFML_Test.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Owner\My Documents\Visual Studio 2008\Projects\SFML_Test\SFML_Test\Debug\BuildLog.htm"
SFML_Test - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Errors while linking
« Reply #5 on: January 24, 2011, 07:41:58 am »
Link to sfml-main.
Laurent Gomila - SFML developer

totalwar235

  • Newbie
  • *
  • Posts: 11
    • View Profile
Errors while linking
« Reply #6 on: January 25, 2011, 01:45:46 am »
ok, i did get the original error to fix. i continued with the tutorial on the main site and got a new set of errors as soon i got to gl- prefixes. i buil the rotating cube code and i get these errors.


1>------ Build started: Project: Test_SFML, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>Linking...
1>Main.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glVertex3f@12 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glTranslatef@12 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glDepthMask@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) referenced in function _main
1>C:\Users\Reed\Documents\Visual Studio 2008\Projects\Test_SFML\Debug\Test_SFML.exe : fatal error LNK1120: 16 unresolved externals
1>Build log was saved at "file://c:\Users\Reed\Documents\Visual Studio 2008\Projects\Test_SFML\Test_SFML\Debug\BuildLog.htm"
1>Test_SFML - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

will i have to download the opengl sdk and install that as well?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Errors while linking
« Reply #7 on: January 25, 2011, 07:39:18 am »
There's no OpenGL SDK, you already have all the GL libraries. Here you need opengl32.lib and glu32.lib.
Laurent Gomila - SFML developer

totalwar235

  • Newbie
  • *
  • Posts: 11
    • View Profile
Errors while linking
« Reply #8 on: January 26, 2011, 02:22:00 am »
thank you so much laurent, i am very new to libraries so thank you for helping me out. i appreciate it a lot.