473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

PLEASE HELP! Strange gcc compilation error

Could a C++ guru help me please? I have a very odd compilation error.
The following is the .h file:
#ifndef TEST_H
#define TEST_H

#include <iostream>
#include "rando.h"
#include "prime.h"

using namespace std;

class ABC{
Rando rn;
public:
ABC();
~ABC();
};

#endif

The .C file is:
#include "test.h"

ABC::ABC(){}

ABC::~ABC(){}

int main(){
return 0;
}

The compilation error message is:
$ g++ -g -o test test.C rando.C
test.h:11 'Rando' is used as a type, but not defined as a type

Could someone please tell me what I am doing wrong? I have in the
past put classes as members of other classes, and they have compiled
without any problems. Thanks in advance for your help!
Jul 22 '05 #1
2 1209
Gandu wrote:
Could a C++ guru help me please? I have a very odd compilation error.
The following is the .h file:
#ifndef TEST_H
#define TEST_H

#include <iostream>
#include "rando.h"
#include "prime.h"

using namespace std; NEVER put global using directives in an include file you expect people
to have to use.

class ABC{
Rando rn;


So where is Rando defined? That seems to be your problem.

It probably should be in rando.h, but I suspect you've screwed something
up there.
Jul 22 '05 #2
"Gandu" <cp**********@yahoo.com> wrote in message news:3c**************************@posting.google.c om...
Could a C++ guru help me please? I have a very odd compilation error.
The following is the .h file:
#ifndef TEST_H
#define TEST_H

#include <iostream>
#include "rando.h"
#include "prime.h"

using namespace std;

class ABC{
Rando rn;
public:
ABC();
~ABC();
};

#endif .... The compilation error message is:
$ g++ -g -o test test.C rando.C
test.h:11 'Rando' is used as a type, but not defined as a type

Could someone please tell me what I am doing wrong?
My guess would be that 'Rando' has not been defined as a type,
and your attempt to use it as one represents a spelling error.
What makes you think 'Rando' names a type?
I have in the
past put classes as members of other classes, and they have compiled
without any problems.
That is not the problem here, either.
Thanks in advance for your help!


--
--Larry Brasfield
email: do***********************@hotmail.com
Above views may belong only to me.
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql,...
2
by: m3ckon | last post by:
Hi there, had to rush some sql and am now going back to it due to a slow db performance. I have a db for sales leads and have created 3 views based on the data I need to produce. However one...
3
by: Lodewijk van Haringhal | last post by:
I'am new with javascritping not with programming. Is there nobody who can help me with ths simple promblem? :) Please, please give me a hint. Please help me with this script. I have two lists in...
0
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web...
7
by: Alan Bashy | last post by:
Please, guys, In need help with this. It is due in the next week. Please, help me to implement the functions in this programm especially the first three constructor. I need them guys. Please, help...
5
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
1
by: Steve | last post by:
Hi, I've asked this question a couple of times before on this forum but no one seems to be nice enough to point me to the right direction or help me out with any information, if possible. Please...
13
by: sd00 | last post by:
Hi all, can someone give me some coding help with a problem that *should* be really simple, yet I'm struggling with. I need the difference between 2 times (Target / Actual) However, these times...
0
by: 2Barter.net | last post by:
newsmail@reuters.uk.ed10.net Fwd: Money for New Orleans, AL & GA Inbox Reply Reply to all Forward Print Add 2Barter.net to Contacts list Delete this message Report phishing Show original
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.