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

Replies

- page 3
Oldest  Newest  Rating
0 Brian Reed · April 15, 2015
Ok, I've solved the issue:D


#include "People.h" is missing from Birthday.cpp

I believe this is required because the Birthday object within "People.h" must be readily identifiable to the Birthday class.


Cheers,
Brian
0 Brian Reed · April 22, 2015
Lachian,

I reloaded Code Blocks again and run everything new again, but I'm now stuck like you are with:

People.cpp||error: expected constructor, destructor, or type conversion before '(' token 

I don't know exactly what is causing this issues, but I have exhausted all possible things I can think of to get it to work. I had it working once after playing around with it the first time, but since can't figure out what I did to make it work. Others have run the code without this issue or have used other platforms (because of Code Block issues).

 So, at this point I would suggest that you try and another compiler to run this lesson or the rest of the tutorials. However, I think you can finish the remaining tutorials without issue ( suggest reading on C++ compositions if you skip).

Anyone else have something to add?

Cheers,
Brian
0 Rami Abdelbaki · April 28, 2015
Hi everybody;

The solution is here:
you don't need to include the header file of birthday class in people.h
What you need to do is just removing that header file ( #include "Birthday.h" ) from the header file (People.h) and everything will go fine.
 

best wishes;
Rami
0 Lachlan S · April 23, 2015
Thanks for the heads up and material, I was just worried that I would never be able to do classes as it happened on tutorial 45 as well. i'll give the others a shot soon and try out ms visual studio (you can get it for free) (i need to learn it though)

C++

107,200 followers
About

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

Links
Moderators
Bucky Roberts Administrator