help with tutorial 45, 46, 47

+1 Lachlan S · April 10, 2015
Can anyone help me with these? does anyone know cans and can'ts of classes and stuff. i have been getting nothing but errors, undefined references, all sorts. I can be more specific but does anyone know general rules.

Some Questions:

people::people ( can the latter be different to the first?)

Pretty much, how can I properly write tutorial 45,46,47 with objects that were named differently to their classes? 

Post a Reply


- page 2
Oldest  Newest  Rating
0 Lachlan S · May 13, 2015

That was it! Thank you so much Michael and Brian, you guys are awesome.

Thanks so much!!!!

0 isabel baker · April 25, 2015
I am having many problems such as you speak of, I'm sure it's codeblocks.
Why do I think that because with out ever having to change my code, I have cured all of these simular problems by starting out new or restarting code blocks. It just gets confused and it is messing up on the stuff it does in the back ground. I will many times once starting out new and getting it to work, I will go back and try the old project that didn't work, only to find it working now.
I am going to start working with eclipse to see if it has problems with classes on different pages.
Codeblocks like visual studio does a lot of thing out of sight out of our minds which saves us a lot of time but when it messes up your screwed. Like unchecking and checking thing when we create a new class, where and what is being stored and how do we manualy do it or check it.
0 Lachlan S · April 13, 2015
Thanks, but with the tutorials, if I copy everything exactly from the github document, I still get an error (tutorial 46, 47) "||=== Build: Debug in check (compiler: GNU GCC Compiler) ===|
C:\Users\Home\Documents\Me\check\People.cpp|6|error: expected constructor, destructor, or type conversion before '(' token|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|" Do you know what is up with this?
0 Brian Reed · April 13, 2015
Hello Lachian,

The only thing I can think of from what I can glean about your compiler error is it might have something to do with the "Has destructor" checkbox you selected when creating the class (assuming you're using codeblocks). The totorial shows it needs to be unchecked. So, if it was me, I would just redo this as a new project as I don't know how to check for the selection after the class is created.

If you try making a new project and still can't resolve this issues, please provide the code you're trying to run. I am willing to work with you on this until your problem is resolved.

0 Lachlan S · April 14, 2015
Thanks for the help, i remember un-checking has destructor when i made the program, I made it yesterday to see if it actually run, and then I copied and pasted the entire git-hub document in their respective files just to see if it would work (i wanted to see if it was mine or the programs fault). but ill check it again today.
0 Lachlan S · April 14, 2015
Today when I run it exactly the same, I am getting three errors, which are exactly the ones i got when i followed the instructions, but it sort of makes me feel better that its not me haha. 

P.S. i am using codeblocks. Is visual studio good? i may start using it.
0 Lachlan S · April 14, 2015
errors are: 
C:\Users\Home\Documents\Me\check\main.o:main.cpp|| undefined reference to `Birthday::Birthday(int, int, int)'|
C:\Users\Home\Documents\Me\check\main.o:main.cpp|| undefined reference to `People::People(std::string, Birthday)'|
C:\Users\Home\Documents\Me\check\main.o:main.cpp|| undefined reference to `People::printInfo()'|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
0 Lachlan S · April 21, 2015
Any more help?
0 Lachlan S · April 14, 2015
Its the github code, exactly the  same 

0 Brian Reed · April 15, 2015
Hello Lachian,

Thanks for posting the code it helps everyone to see and work the exact problem.
I've pasted it in Code Blocks and I'm getting the same errors you have.
I seem to remember running into this problem before when I first worked the tutorial last month.
I was sure I found the problem then, but I can remember or find reference to it :O
I must have been thinking, aah I've got this down pat, bad move! :angry:

Since then, I now take the time to create a new project for each important concept and comment on everything to explain what is going on with the code (its a great way to have a solid reference).
 I thought I had done so for this one, just can't find it :(

Just letting you know now that I will find the problem again and post it when I do. Unless someone beats me to the punch:)

I'm thinking it has something to do with the referencing between classes.



Used in many types of software including music players, video games, and many large scale applications.

Bucky Roberts Administrator