C++ vid 15

+1 Divulger Michealson · August 16, 2015
my thing is not woking

#include <iostream>
#include <string>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include "Tut.h"
using namespace std;

int main()
{
    Tut bo;
    return 0;
}



#ifndef TUT_H
#define TUT_H


class Tut
{
    public:
        Tut();

};

#endif




#include "Tut.h"
#include <iostream>

using namespace std;

Tut::Tut()
{
    cout << "i love wings" << endl;
}




i got this sms.
C:\Users\confidential\AppData\Local\Temp\cc4qC.o: In function `main':
C:/Users/confidential/Desktop/C_tutorials/c++_tutorials/Jay/main.cpp:11: undefined reference to `Tut::Tut()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))



Post a Reply

Replies

Oldest  Newest  Rating
+1 Scott Walker · August 16, 2015
Hi mate,

This is a problem with the Code::Blocks IDE.

Just save the project, exit Code::Blocks and then re-open.

Hope this helps
+1 Divulger Michealson · August 16, 2015
did that twice 
0 Divulger Michealson · August 16, 2015
um i made a timetables program for mi sibling but i made it in C is it possible to convert it to java so it can reach her android device
+1 Mohamed Hosny · August 16, 2015
Everything seems fine. It sounds like a linking error to me. Are you sure you have all the project files open in the same folder?
0 Divulger Michealson · August 17, 2015
yea am totally sure
0 Adam Tindall · August 17, 2015
Hey Buddy I had the same issues so went ahead and did some trouble shooting and made working to date programs:

https://github.com/atindall728/TheNewBoston.CPlusPlus_RunningPrograms1-40WithNotes
tch 
I am working to do the same with deconstructors tutorial which has a similar bug :)  Will keep updating these.

Please feel free to download program 15 and should be able to compare and address issue.  Good luck!

https://github.com/atindall728/TheNewBoston.CPlusPlus_RunningPrograms1-40WithNotes/tree/master/15.PlacingClassesInSeparateFilesTheNewBostonC%2B%2B
0 Adam Tindall · August 21, 2015
try returning this before return 0; cin.ignore().get(); in main.  It will "properly" pause your program so you can see your work.

Cheers
0 Divulger Michealson · August 22, 2015
i got it to work in code blocks but thanks
  • 1

C++

107,070 followers
About

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

Links
Moderators
Bucky Roberts Administrator