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

Author Topic: SFML Book Project - Can't find the mistake  (Read 1058 times)

0 Members and 1 Guest are viewing this topic.

Soziapath

  • Newbie
  • *
  • Posts: 4
    • View Profile
SFML Book Project - Can't find the mistake
« on: October 13, 2014, 01:52:11 pm »
Hello SFML-dev community,

I'm currently programming the project from the SFML Game Developüment book.
Due to the fact that the shown code and their explanation don't match, i sometimes got errors, which i can normally fix without much effort. But this time i just can't fix it...

I finished the SceneNode tutorial and my Entity Class should be able to inherit SceneNode, but there are link-errors. If i delet the inheritation from the Entity Class there is no error...

Here's a link to the download of my project
http://www.file-upload.net/download-9677731/SFML-Book.7z.html
And Antivirus-Scan if you don't trust me^^
https://www.virustotal.com/de/file/42d757e041a40521a9a2f061aacad1c07ffba5d8e47f069adaf9ac0e117d8e18/analysis/1413200850/

Or if the Code of Entity and SceneNode is enaugh..

SceneNode.h
(click to show/hide)

Entity.h
(click to show/hide)

if you use the Project, my sfml-files are in D:\SFML-2.1x86

Hope you can help me...
Soziapath


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: SFML Book Project - Can't find the mistake
« Reply #1 on: October 13, 2014, 01:57:40 pm »
You need to provide the errors as well. We can't really work with "something is broken, here's the code, figure it out please". :D
And yeah nobody is really going to download the full project. Instead you should further isolate the issue. ;)

The book intentionally doesn't show all the code used in the end, as such it's required to look at the full code. However the archive from Packt itself is outdated. The error free code can be found here.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Soziapath

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML Book Project - Can't find the mistake
« Reply #2 on: October 13, 2014, 02:08:27 pm »
Sorry, are now attachted to this reply...

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML Book Project - Can't find the mistake
« Reply #3 on: October 13, 2014, 05:17:39 pm »
As eXpl0it3r said, you should get the code from GitHub, as it is correct and up-to-date.

If you really want to write it on your own -- which is rather pointless if you do it 1:1 -- you have to consider the usual things to avoid linker errors: make sure the function definition is available to the compiler (i.e. in a .cpp file that will be compiled), and that its signature matches the function declaration exactly.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything