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

Author Topic: Trouble Building in VS2008  (Read 5923 times)

0 Members and 2 Guests are viewing this topic.

brent_w

  • Newbie
  • *
  • Posts: 6
    • View Profile
Trouble Building in VS2008
« on: August 07, 2008, 08:53:56 pm »
Hi, I'm new to SFML, and I've been going through the tutorials.
I had no trouble with the "system" package, but as soon as I attempted to build a program with the "window" package I started getting the following errors:

Code: [Select]
1>------ Build started: Project: sfml_window_and_event, Configuration: Debug Win32 ------
1>Linking...

1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Clock::Reset(void)" (?Reset@Clock@sf@@QAEXXZ) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)

1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "void __cdecl sf::Sleep(float)" (?Sleep@sf@@YAXM@Z) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)

1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)

1>sfml-window-s.lib(Window.obj) : error LNK2019: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) referenced in function "public: __thiscall sf::Window::Window(void)" (??0Window@sf@@QAE@XZ)

1>C:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\sfml_window_and_event.exe : fatal error LNK1120: 4 unresolved externals

1>Build log was saved at "file://c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\sfml_window_and_event\Debug\BuildLog.htm"

1>sfml_window_and_event - 5 error(s), 1 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


This is what my code looks like:
Code: [Select]
// sfml_window_and_event.cpp : Defines the entry point for the console application.
//

#include <SFML/Window.hpp>

int main() // SFML Basics : Windows & Events
{
// Create a window object. (App)
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");  

// Displaying the window
while(App.IsOpened())
{
sf::Event Event; // Declaring an event object;

App.Display(); // Displays the Window

// Checking for a window event:
while(App.GetEvent(Event)) // All events go into a stack, we loop to ensure we've caught them all.
{
// Process event

// Window closed
   if (Event.Type == sf::Event::Closed)
{App.Close();}

// Escape key pressed
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
{App.Close();}
}
}
return 0;
}


Could someone please tell me what I'm doing wrong to cause these errors?

Avency

  • Full Member
  • ***
  • Posts: 113
    • View Profile
Trouble Building in VS2008
« Reply #1 on: August 08, 2008, 11:49:55 am »
You need to link both, window and system package.

brent_w

  • Newbie
  • *
  • Posts: 6
    • View Profile
Trouble Building in VS2008
« Reply #2 on: August 08, 2008, 04:44:42 pm »
Ok, thank you, that helps.

Now I'm problems errors in debug mode (it runs fine in release mode), but I'm new to Visual Studio as well, so I'm going to make sure I'm not using debug mode incorrectly.


This is my error:
Code: [Select]
Run-Time Check Failure #2 - Stack around the variable 'App' was corrupted.It occurs right after I close the App window.

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Trouble Building in VS2008
« Reply #3 on: August 08, 2008, 05:34:07 pm »
Quote from: "brent_w"
Ok, thank you, that helps.

Now I'm problems errors in debug mode (it runs fine in release mode), but I'm new to Visual Studio as well, so I'm going to make sure I'm not using debug mode incorrectly.


This is my error:
Code: [Select]
Run-Time Check Failure #2 - Stack around the variable 'App' was corrupted.It occurs right after I close the App window.


2 things to check...

1 (most likely)) Are you linking in the debug libraries for the debug build?  If you are still linking the release libraries, you will randomly crash.

2) Debug mode does many more continual runtime checks than release.  If you write to memory you shouldn't be in debug, you will get an error like that.  In release mode, it might appear to work, but could randomly crash / use corrupt values later.

brent_w

  • Newbie
  • *
  • Posts: 6
    • View Profile
Trouble Building in VS2008
« Reply #4 on: August 08, 2008, 05:46:38 pm »
Well, I've tried linking the debug libraries, and now I get massive linking errors.

Code: [Select]
1>------ Build started: Project: sfml_window_and_event, Configuration: Debug Win32 ------

1>Compiling...

1>sfml_window_and_event.cpp

1>stdafx.cpp

1>Generating Code...

1>Linking...

1>sfml-system-s-d.lib(Platform.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-system-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-system-s-d.lib(Clock.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-system-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-system-s-d.lib(Sleep.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-system-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-window-s-d.lib(Joystick.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-window-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-window-s-d.lib(VideoModeSupport.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-window-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-window-s-d.lib(WindowImplWin32.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-window-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-window-s-d.lib(Input.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-window-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-window-s-d.lib(VideoMode.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-window-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-window-s-d.lib(Window.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-window-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>sfml-window-s-d.lib(WindowImpl.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\sfml-window-s-d.lib' or at 'c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\Debug\vc90.pdb'; linking object as if no debug info

1>Embedding manifest...

1>mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\sfml_window_and_event.exe.embed.manifest". The parameter is incorrect.

1>Build log was saved at "file://c:\Users\Brent\Documents\Visual Studio 2008\Projects\sfml_window_and_event\sfml_window_and_event\Debug\BuildLog.htm"

1>sfml_window_and_event - 1 error(s), 10 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


So ... I'm still sort of stuck here.

brent_w

  • Newbie
  • *
  • Posts: 6
    • View Profile
Trouble Building in VS2008
« Reply #5 on: August 22, 2008, 09:49:14 pm »
Does anyone know what those warnings I was getting mean?

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Trouble Building in VS2008
« Reply #6 on: August 22, 2008, 11:39:48 pm »
Perhaps the libraries aren't built properly. Have you tried rebuilding them?