I'm getting the error:
Twitter.cpp: In function ‘int main()’:
Twitter.cpp:46: error: request for member ‘addtweet’ in ‘tw’, which is of non-class type ‘Twitter()’
Twitter.cpp:47: error: request for member ‘gettweet’ in ‘tw’, which is of non-class type ‘Twitter()’
If anyone can look at my code and let me know I would greatly appreciate it. Thank you in advance.
I changed it and got quite a few more errors. Do you know what to put in the default constructor Twitter::Twitter()? I left it blank because I didn't know what code to put in.
/tmp/ccNfccdU.o: In function `Twitter::gettweet(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Twitter.cpp:(.text+0x62): undefined reference to `Tweet::getSubject()'
Twitter.cpp:(.text+0xf2): undefined reference to `Tweet::Tweet()'
/tmp/ccNfccdU.o: In function `main':
Twitter.cpp:(.text+0x178): undefined reference to `Tweet::Tweet(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
Twitter.cpp:(.text+0x263): undefined reference to `Tweet::addstring(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
Twitter.cpp:(.text+0x3ab): undefined reference to `Tweet::getSubject()'
Twitter.cpp:(.text+0x405): undefined reference to `Tweet::getMessage()'
collect2: ld returned 1 exit status
Ok, my guess is that the things you just posted are two different files, Tweet.h and Tweet.cpp, and Tweet.cpp is not included in your project. I want you to try this: Copy the content of Tweet.cpp in Tweet.h, before the #endif directive, and try to compile Twitter.cpp (the one you have main in).