SFML community forums

Help => General => Topic started by: Jalfor on June 18, 2011, 01:41:06 pm

Title: Error
Post by: Jalfor on June 18, 2011, 01:41:06 pm
Code: [Select]
1>------ Build started: Project: SFML Test WORKING, Configuration: Debug Win32 ------
1>sfml-graphics-s-d.lib(Color.obj) : error LNK2005: "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) already defined in sfml-graphics-d.lib(sfml-graphics-d.dll)
1>D:\programming\C++ projects\SFML Test WORKING\Debug\SFML Test WORKING.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


That is the error I am getting when compiling a pre-written thing on shapes in the tutorial section. Thanks in advance.
Title: Error
Post by: Laurent on June 18, 2011, 01:53:22 pm
You're linking to both the static and dynamic versions of sfml-graphics. This makes no sense, link to only one version.
Title: Error
Post by: Jalfor on June 18, 2011, 02:09:58 pm
Code: [Select]
1>------ Build started: Project: SFML Test WORKING, Configuration: Debug Win32 ------
1>Main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)
1>Main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Yellow" (?Yellow@Color@sf@@2V12@B)
1>Main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Blue" (?Blue@Color@sf@@2V12@B)
1>Main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Red" (?Red@Color@sf@@2V12@B)
1>D:\programming\C++ projects\SFML Test WORKING\Debug\SFML Test WORKING.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Now this is the error I'm getting.
Title: Error
Post by: Laurent on June 18, 2011, 02:41:11 pm
You must define SFML_DYNAMIC.
Title: Error
Post by: Jalfor on June 18, 2011, 02:51:42 pm
how do I do that?
Title: Error
Post by: Laurent on June 18, 2011, 03:11:11 pm
It's explained in the tutorial.
Title: Error
Post by: Jalfor on June 18, 2011, 03:37:34 pm
Sorry for not realizing that even though it was in the tutorial. New error now.

Code: [Select]
'SFML Test WORKING.exe': Loaded 'D:\programming\C++ projects\SFML Test WORKING\Debug\SFML Test WORKING.exe', Symbols loaded.
'SFML Test WORKING.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'SFML Test WORKING.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'SFML Test WORKING.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
'SFML Test WORKING.exe': Loaded 'D:\programming\C++ projects\SFML Test WORKING\SFML Test WORKING\sfml-graphics-d.dll', Cannot find or open the PDB file
The program '[4924] SFML Test WORKING.exe: Native' has exited with code -1072365566 (0xc0150002).
Title: Error
Post by: Laurent on June 18, 2011, 03:49:17 pm
Ok, now it's a runtime error (compiling and linking are ok), so you can run the debugger (F5) to know what's wrong ;)

By the way, in your next message you should give us more information about your system (OS, compiler, version of SFML, ...).
Title: Error
Post by: Jalfor on June 18, 2011, 04:03:28 pm
I've been running the debugger all along, what I posted above is the output. also, it comes up with a popup window saying

The application was unable to start correctly (0xc0150002). Click OK to close the application.

Also, I won't be able to post a response for a few hours as I am going to sleep now.

As always, thanks for the help.
Title: Error
Post by: Laurent on June 18, 2011, 04:10:48 pm
This output is not from the debugger, this is the regular output.

The debugger:
- shows you where the crash happened in the source code
- shows you the call stack at the moment of the crash
- can show you much more information but these two things should be enough ;)
Title: Error
Post by: Jalfor on June 19, 2011, 05:02:06 am
http://www.youtube.com/watch?v=4yVEYInhh50

That should give you some more information on what I'm doing.
Title: Error
Post by: Laurent on June 19, 2011, 10:12:22 am
I see. This kind of error popup often means that a DLL couldn't be found. You must make sure that the SFML DLLs are located in your working directory (which is defined in your project settings -- should be the project directory by default, but I recommend changing it to the executable directory).
Title: Error
Post by: Jalfor on June 19, 2011, 12:30:15 pm
http://www.youtube.com/watch?v=P8EB_9MNayY

It is probably easier for both you and me if I just show you things with YouTube videos as that is a lot easier than trying to explain it and you can see I'm not doing anything stupid.
Title: Error
Post by: Laurent on June 19, 2011, 01:05:04 pm
Did you first recompile SFML? (VC2008 libs are not compatible with VC2010 -- half of the forum topics are about this)
Title: Error
Post by: Jalfor on June 19, 2011, 01:32:29 pm
oh, I thought that the converting thing fixed that. I'll do that now and get back to you with my result after I've done that.
Title: Error
Post by: Laurent on June 19, 2011, 01:37:49 pm
What converting thing?
Title: Error
Post by: Jalfor on June 19, 2011, 02:10:44 pm
IT WORKED!!!

Thanks SO much for your help. I look forward to showing you what I make with SFML!