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

Author Topic: Mastering SFML Game Development - Sourcecode problems  (Read 2238 times)

0 Members and 1 Guest are viewing this topic.

Schorsch

  • Newbie
  • *
  • Posts: 6
    • View Profile
Mastering SFML Game Development - Sourcecode problems
« on: April 06, 2018, 08:25:49 am »
Hey,
i tried to build the sourcecode of this book and got many many errors. For example, i tried to build chapter twos sources. It took me a while but i could fix the errors. The thing is, this source could never compile. Header names in include-statements were written wrong, variable names were being reused, but assigned with different types which can never be casted into each other, doing unconst stuff in const functions and so on. So i shouldn't be the only one with those problems, but i found no other topic about that. Like i wrote, i fixed those compiler errors and got the build, but after starting, there is a segmentatino fault. Next step will be debugging, but if even chapter two has so many problems, i don't know if i want to go further with this book. I think at least the author had run this code and presumably some other people too. So maybe those problems are known and i don't have to fix them all by my own.
I know, this is a very special question and you cannot help me if you didn't tried to build and run this code. I just want to know if someone just solved the same issues.

ps: if someone wants to try it by himself, i made a CMakeLists.txt for chapter two.

Maybe i have some luck :) Have a nice day.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Mastering SFML Game Development - Sourcecode problems
« Reply #1 on: April 06, 2018, 08:57:16 am »
Maybe check out the original thread and if you can't find a solution, you could try and contact the author: https://en.sfml-dev.org/forums/index.php?topic=21916.0
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Schorsch

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Mastering SFML Game Development - Sourcecode problems
« Reply #2 on: April 06, 2018, 09:13:21 am »
Hey eXpl0it3r,

i already saw this thread. But my topic isn't fitting in there i think. But if you want, move this post there. I wrote a private message to the author this morning. But thanks for the tip.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Mastering SFML Game Development - Sourcecode problems
« Reply #3 on: April 06, 2018, 09:18:06 am »
No need to move, I mainly wanted to make you aware of it as it would be the most likely source of finding some solution to your problem, if someone had already had similar issues. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Schorsch

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Mastering SFML Game Development - Sourcecode problems
« Reply #4 on: April 06, 2018, 09:24:44 am »
They write about another problem, but they got the project working. But never with the source from github. Like i said, there are errors, no compiler would ever accept. Maybe it is just this version of the code which is broken and someone has a valid one. Maybe the author by himself. Let's hope :)

edit:
So i had some time for first debugging. The event manager has lots of problems. First of all, the LoadBindings() method reads a line and get's an error because it reads while EOF isn't true. The problem is that a line ends with a linebreak, so EOF is false, even if the line was read complete. I fixed that. Now there are multiple problems with the creation of the events itself. I fixed the first one, but it is really hard work because i sometimes don't even know what the author wanted to do in that case. I think there must be some code out there that works, so maybe debugging this wrong code is useless time. I hope that someone could help. But now i have to go back to real work :D

edit 2:
So i found out that the author wrote another book which explains most of the parts from chapter 1. I got the code and saw that it has the same errors as in his newer book. I don't know how someone could ever release thiss mess. But it is easier to remove the bugs from the old code, because in each chapter, only a few components are added and so the amount of new errors isn't as big as in the first chapter of the new book. So after some hours, i fixed the first 8 chapters of the olds books code. It isn't that easy because i don't own a copy of the book, so i lack some information and have to guess in some cases. I have to check the license later, if i am able to, i will release the fixed version of the code, unless i jump out of the window after some more hours of debugging ;)
« Last Edit: April 08, 2018, 05:47:05 pm by Schorsch »