473,566 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Header include problems error: expected class-name before '{' token

Hi,

i´ve got about 10 headerfiles with implemented classes. Now when i try
to compile them i get the following message:

In file included from Proxy/ServerCnx.hh:36 ,
from Proxy/Payload.hh:30,
...
from main.cc:28
Proxy/Interface.hh:83 : error: expected class-name before '{'
The Interface.hh looks like this:

class Module : public ClientCnx{...}

so far, i realisied that ClientCnx isn´t declarated. So I tried to
make a forward Declaration
by using

class ClientCnx;
but now, the compiler says:

Proxy/Interface.hh:83 : error_ invalid use of undefined type `ClientCnx`
Proxy/Interface.hh:30 : error_ forward declaration of `ClientCnx`
now what can i do to fix this prob ?!?

Sep 25 '06 #1
2 8397
bubzilla wrote:
i´ve got about 10 headerfiles with implemented classes. Now when i try
to compile them i get the following message:

In file included from Proxy/ServerCnx.hh:36 ,
from Proxy/Payload.hh:30,
...
from main.cc:28
Proxy/Interface.hh:83 : error: expected class-name before '{'

The Interface.hh looks like this:

class Module : public ClientCnx{...}
You want comp.lang.c++.

--
Chris "falling further in" Dollin
A rock is not a fact. A rock is a rock.

Sep 25 '06 #2
sry!
ok now it´s in comp.lang.c++

thx

Sep 25 '06 #3

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

Similar topics

11
2738
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do understand the objective. This example may represent an interface in need of a bit of refactoring, but it goes to demonstrate the basic idea as I...
2
1619
by: Jacob | last post by:
A problem I've been rather stuck on and, try as I might, have not been able to find the answer to. I've written a nice little class that I want to include in another project. The class works fine if I have it all in one big file, but I run into problems when I try to break it down into source and header files. I get a linker error when I...
3
3081
by: pooja | last post by:
Suppose i have created a class c1 with f1()in c1.cpp and included this c1.cpp in file1.cpp file , which is also having main() by giving the statement #include "c1.cpp". the same i can do by using header file. i can create a class c1 with f1() in c1.h and include this c1.h in file1.cpp by giving the statement #include "c1.h" tell me that...
60
8228
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header associated with this source file For example, in a file hello.c: #include <stdio.h>
4
1701
by: Agos | last post by:
I'm trying to learn VC++.NET. I used till now Borland C++ Builder 6. I had a program starting like this: #include <fstream.h> #define TEMP_FILES 200 ...... ....... fstream chunk_file; With Borland and g++ I had no problems with these lines instead VC++.NET
12
2082
by: Ben | last post by:
I'm kind of new to creating templates. I've made some small class and function templates in the past and I have used quite of bit of the STL, but I am having problems tyring to create templates. I'm trying to make class templates in seperate header files with pointers to each other, and I am getting strange errors. Is it possible to do?
11
2789
by: Gary Wessle | last post by:
Hi is it right to have a line like #include <path/to/header.hfor a library on my system, in my header file and use some functions provided by this library in the implementation file (file.cpp) inside a class with out declaring those functions in the class declaration in the header file? thanks
36
3804
by: zouyongbin | last post by:
Stanley B Lippman in his "C++ Primer" that a definition like this should not appear in a header file: int ix; The inclusion of any of these definitions in two or more files of the same program will result in a linker error complaining about multiple definitions. So this kind of definition should be avoided as much as possible. But as we...
4
6921
by: liyanage | last post by:
I recently worked on error handling and three related issues/questions came up. 1.) I am trying to trigger Apache ErrorDocument handlers by setting appropriate HTTP status codes in my PHP code, but I don't get the expected results. My PHP file:
3
3255
by: rorni | last post by:
Hi, I'm porting code from Windows to HP-UX 11, compiling with g++. I'm getting a compilation error on the system's debug.h include file, which is included very indirectly through a series of other system include files. The one I am including is <map> . The errors I am getting are:...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7644
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.