Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-26-2011, 12:57 AM   PM User | #1
worldtraveller
Regular Coder

 
Join Date: Nov 2010
Location: canada
Posts: 131
Thanks: 51
Thanked 0 Times in 0 Posts
worldtraveller is an unknown quantity at this point
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
worldtraveller is offline   Reply With Quote
Reply

Bookmarks

Tags
c++, xcode

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:43 PM.


Advertisement
Log in to turn off these ads.