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

Author Topic: [Solved]So much for this tutorial...  (Read 3171 times)

0 Members and 1 Guest are viewing this topic.

TickingHands

  • Newbie
  • *
  • Posts: 6
    • View Profile
[Solved]So much for this tutorial...
« on: December 03, 2009, 03:03:51 am »
Edit: Solved

Edit: Okay, scratch that. It isn't just that line or problem. There are too many to type out lol. If you could just compile the code( download below ) and help me fix the problems that would very nice of you and would be awesome.

Alright, I'm doing the tutorials here http://redkiing.wordpress.com/category/games/sfml/ .

My problem is that there is a line of code

Code: [Select]

sf::Color::Color boardColor;


Which renders many nasty errors( In fact all the errors I have are from this )

Errors:
Code: [Select]

Error 1 error C2146: syntax error : missing ';' before identifier 'boardColor'

Error 2 error C2602: 'sf::Color::{ctor}' is not a member of a base class of 'Board'

etc...


This line is in the class Board. The corresponding piece of code in the .cpp file is this

Code: [Select]

boardColor = sf::Color::Color(0, 102, 153 );


If the rest of the code is needed, I can either put it on here or you can download the source code here http://www.mediafire.com/?lzijniewqww

Oz1571

  • Newbie
  • *
  • Posts: 28
    • View Profile
[Solved]So much for this tutorial...
« Reply #1 on: December 03, 2009, 08:10:04 am »
sf::Color::Color should be sf::Color. :)

TickingHands

  • Newbie
  • *
  • Posts: 6
    • View Profile
[Solved]So much for this tutorial...
« Reply #2 on: December 03, 2009, 09:28:50 am »
Edit 3: I got everything fixed.


Edit 2: Okay, now I need to force quit it lol.

Code: [Select]

Unhandled exception at 0x00005c00 in SFML_Tuts.exe: 0xC0000005: Access violation reading location 0x00005c00.


Hmm... Englishe?

Edit: Fixed... That was stupid. Maybe I should try actually defining what restart does? lol

Alright, now I have these three:

Errors:
Code: [Select]

Error 19 error LNK2001: unresolved external symbol "public: void __thiscall Board::restart(void)" (?restart@Board@@QAEXXZ) uInterface.obj

Error 18 error LNK2019: unresolved external symbol "public: void __thiscall Board::restart(void)" (?restart@Board@@QAEXXZ) referenced in function "public: __thiscall Board::Board(class sf::RenderWindow &)" (??0Board@@QAE@AAVRenderWindow@sf@@@Z) board.obj

Error 20 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\William and Daniel\My Documents\Visual Studio 2008\Projects\SFML_Tuts\Debug\SFML_Tuts.exe


Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1485
    • View Profile
    • Blog
    • Email
[Solved]So much for this tutorial...
« Reply #3 on: December 03, 2009, 02:14:14 pm »
1. There's a "Preview" button below the textarea. Please use it, your postings are hard to follow.
2. Try to use your brain first. ;) When a new problem arises, try to fix it for yourself first. So you won't need those "Ah already fixed" anymore.
3. You probably should get more familiar with the process of compiling and linking -- maybe C++ in general, too.

However, your problem is that "Board::restart()" is used and declared, but not defined.

TickingHands

  • Newbie
  • *
  • Posts: 6
    • View Profile
[Solved]So much for this tutorial...
« Reply #4 on: December 04, 2009, 01:40:42 am »
Yea, I figured that.

Also I actually did not realize I had linked both libraries.

So 1. The preview wouldn't exactly help me... I put the edits at the top of each post to say if you need to disregard the rest of the post or a new error, instead of reposting.
2. Someone else on another forum told me to check if I had accidentally added both libraries or just check that general area.  

I did figure out the whole "restart()" problem, I suppose I could have put the order of edits in a different arrangement. Though I suppose it was easier for me to understand than you or someone else.

Anywho, thanks for the help.

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
[Solved]So much for this tutorial...
« Reply #5 on: December 05, 2009, 12:09:45 am »
It's easier for us to figure out what in the world you're talking about if you'll just leave your original post and put your edits at the end of the post.  That way we can follow the process of what you went through and where you're at now.

It's good you got it working, though.

Edit:  Leaving you're whole thought process, even the parts before you figured something out, will help other people in the future who might have your same problem.

 

anything