|
C++ problems in Xcode
Hello all I am following Buckys video tutorial on C++ of Placing Classes in Separate Files of tutorial 15
at link
ttp://www.youtube.com/watch?v=NTip15BHV ... ure=relmfu
Right now I put up the 3 files.
the
main.cpp
i used test as a file
so i used
test.cpp
and final one is
test.h
I try to run the program I use Xcode and i get an error. However nothing comes up on screen to indicate where the error is.
Anyone help me out.
I will put my code on the screen here
here is the main.cpp file
Code:
//
// main.cpp
// test1
//
// Created by on 11-11-25.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
// introduction to classes and objects 12
#include <iostream>
#include "test.h"
using namespace std;
int main ()
{
test bo;
return 0;
}
Here is the test.cpp file
Code:
//
// test.cpp
// test1
//
// Created by on 11-11-25.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#include "test.h"
#include <iostream>
using namespace std;
test::test() // this says function is member of same class
{
cout << " i like apples " << endl;
//test
}
and finally
here is the test.h
file
Code:
//
// test.h
// test1
//
// Created by on 11-11-25.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#ifndef test_h
#define test_h
class test
{
public:
test();
};
#endif // test_h
Now i have tried to run on all 3 screens and still get error message.
the error message i get in Xcode is this
Quote:
Command /Developer/usr/bin/clang++ failed with exit code 1
So I am confused to what I am doing wrong. as i followed the tutorial to the T
What suggestions can you all make?
thanks and i await your replies.
I use Xcode 4.2
|