Problem with include


 
Thread Tools Search this Thread
Top Forums Programming Problem with include
# 1  
Old 10-07-2011
Problem with include

I have been playing with some classes and am getting the following error

Code:
baseLib/lininterp.h:182: error: expected class-name before ‘{’ token
baseLib/lininterp.h:227: error: expected class-name before ‘{’ token
baseLib/lininterp.h:269: error: expected class-name before ‘{’ token
baseLib/csinterp.h:200: error: expected class-name before ‘{’ token
baseLib/csinterp.h:248: error: expected class-name before ‘{’ token
baseLib/csinterp.h:299: error: expected class-name before ‘{’ token
baseLib/pdinterp.h:180: error: expected class-name before ‘{’ token
baseLib/pdinterp.h:240: error: expected class-name before ‘{’ token
baseLib/pdinterp.h:281: error: expected class-name before ‘{’ token

I have the following C++ structure

Code:
interp.h

   class Interp1D
   class Interp2D

   class CSInterp1D : public Interp1D
   class VSInterp1D : public Interp1D
   class CSInterp2D : public Interp2D
   class VSInterp2D : public Interp2D

   # include "lininterp.h" 
   # include "csinterp.h"
   # include "pdinterp.h"

lininterp.h

   class LinCSInterp1D : public CSInterp1D
   class LinVSInterp1D : public VSInterp1D
   class LinCSInterp2D : public CSInterp2D
   class LinVSInterp2D : public VSInterp2D

csinterp.h

   class CSCSInterp1D : public CSInterp1D
   class CSVSInterp1D : public VSInterp1D
   class CSCSInterp2D : public CSInterp2D
   class CSVSInterp2D : public VSInterp2D
 
pdinterp.h

   class PDCSInterp1D : public CSInterp1D
   class PDVSInterp1D : public VSInterp1D
   class PDCSInterp2D : public CSInterp2D
   class PDVSInterp2D : public VSInterp2D

I have separated the classes into separate file like below
Code:
Interp1D

Interp2D

CSInterp1D
   #include "Interp1D"
      class CSInterp1D : public Interp1D
     #include "lininterp.h" 
    #include "csinterp.h"
    #include "pdinterp.h"
 
VSInterp1D
   #include "Interp1D"
    class VSInterp1D : public Interp1D
    #include "lininterp.h" 
   #include "csinterp.h"
   #include "pdinterp.h"

CSInterp2D
   #include "Interp2D"
    class CSInterp2D : public Interp2D
    #include "lininterp.h" 
   #include "csinterp.h"
   #include "pdinterp.h"

VSInterp2D
   #include "Interp2D"
   class VSInterp2D : public Interp2D
    #include "lininterp.h" 
   #include "csinterp.h"
   #include "pdinterp.h"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Include files

I have an implementation file tomog.cpp that implements a class called Tomog where I need to include its header file which resides in another place. How can I best specify the include file? I would not like to do #include "../../tomso/tomography/tomog.hpp" I wish to do instead ... (3 Replies)
Discussion started by: kristinu
3 Replies

2. Red Hat

%include in kickstart

RHEL 5.4 I'm trying to use %include statements in my kickstarts, and am running into some problems. In %pre, I can %include /mnt/source/isolinux/setup-questions and that works just fine. One of the things it does is echo out several variables to /tmp/vars In %post --nochroot, I copy... (2 Replies)
Discussion started by: jnojr
2 Replies

3. Programming

help with C #include

i have three files a.h t.c and p.c a.h has 3 functions only and does not include anything p.c has one function i made called go t.c has a main function and calls the go function, it includes a.h only i run the program using gcc -Wall -g -o t p.c t.c but i get a warning, implicet... (2 Replies)
Discussion started by: omega666
2 Replies

4. Shell Programming and Scripting

Problem with sending email(to include contents of text file)

Hello, I was using a shell script for sending contents of a text file(email.report) to different users. I was using the below command in my script to send email... cat email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com It was working fine all these days but now all of a sudden it... (18 Replies)
Discussion started by: smarty86
18 Replies

5. Shell Programming and Scripting

Problem with include Date::Business

Can any one please help how to include Sybase::DBlib, Getopt::Std,Date::Business, Date::Manip in shell Scripting. (2 Replies)
Discussion started by: anupdas
2 Replies

6. Programming

Include directive

Hi there, I'm working on a c++ project and I need to use some libraries which are part of a framework. I installed it on my home directory, and alle the .hh are located in subdirs of my home. I'd like to include the files I need just as if they where std c header, that is: #include... (2 Replies)
Discussion started by: clalfa
2 Replies

7. Shell Programming and Scripting

how to include code

Hi, I have an easy question... My ksh script has a section with non ksh script in it - let's pretent it is VBA code. I need to include this vba script in my ksh script into so that my VBA script can be reused elsewhere by other ksh script by "$include" into other ksh scripts. What is the syntax... (3 Replies)
Discussion started by: ihot
3 Replies

8. Programming

About $include

Hi, In my code,I come across include statements with $ sign what it represents... $include "getsum.h" /* This how I seen in my code */ Sarwan (5 Replies)
Discussion started by: sarwan
5 Replies

9. UNIX for Dummies Questions & Answers

#include?

I have a file that contains some variables that I may want to share throughout multiple scripts. I think there's an #include command in UNIX. How do I use it (in korn)? (1 Reply)
Discussion started by: yongho
1 Replies

10. Programming

Include files

Hi, I am new to the unix networking. I have written one client and server for UDP sockets.. I got the following errors while conpilation I have include all include files. Could some one help ...is there any other file to be included.....? will the include files change on different unix... (3 Replies)
Discussion started by: reddyb
3 Replies
Login or Register to Ask a Question