944,222 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1328
  • C RSS
Aug 12th, 2005
0

Stupid compiler error

Expand Post »
this is probably something extremely stupid but I can't fix it no matter what I try

I have a "Service.h" file that looks like this:

  1. #ifndef _SERVICE_H__
  2. #define _SERVICE_H__
  3.  
  4. #include "nm.h"
  5. #include "ServiceProvider.h"
  6.  
  7. class Service
  8. {
  9. public:
  10. virtual ULONG register(ServiceProvider *sp);
  11. };
  12.  
  13. #endif

gcc gives me error: /export/home/levk/r2/Service.h:10: error: parse error before `*' token

Here's my whole ServiceProvider.h:

  1. #ifndef _SERVICEPROVIDER_H__
  2. #define _SERVICEPROVIDER_H__
  3.  
  4. #include "ace/Reactor.h"
  5.  
  6. typedef ACE_Reactor ServiceProvider;
  7.  
  8. #endif
<< moderator edit: added [code][/code] tags >> - thank you, I was wondering how to do that

ULONG is int (#define ULONG int in nm.h). I've tried not having any arguments for the register function (so I put void there), but I get the same error except it says it's before the void token.

Please help. Thank you in advance
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
levk is offline Offline
11 posts
since Aug 2005
Aug 12th, 2005
0

Re: Stupid compiler error

I figured it out. As predicted, it was unspeakably stupid. I can't call a function register because it's a keyword.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
levk is offline Offline
11 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Pointer question
Next Thread in C Forum Timeline: Is it possible to have a template as an argument to a function?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC