We help IT Professionals succeed at work.

Error in system header file...

alalitha
alalitha asked
on
When I'm trying to compile a program getting the following error.. Not able to figure out whatz causing this...

"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 146: Warning: Too few arguments in macro min.
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 146: Error: No direct declarator preceding "(".
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 146: Error: Use ";" to terminate declarations.
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 147: Error: Use ";" to terminate declarations.
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 147: Warning: Too few arguments in macro max.
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 147: Error: No direct declarator preceding "(".
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 147: Error: Use ";" to terminate declarations.
"/opt/SUNWspro/WS6U1/include/CC/Cstd/./limits", line 149: Error: Use ";" to terminate declarations.


I'm not including limits anywhere in my program. Could anyone guide me thru what could be the problem

Best Regards,

Lalitha
Comment
Watch Question

By your message I think, that reason is wrong call to
macro min/max. Usually error is in disbalance of "(" and ")".
Check it and post here your code with min/max

Author

Commented:
Well I haven't used min/max macro in my program I dont understand why its linking with this file at the first place..
AxterSenior Software Engineer

Commented:
Please post the top of your header and source file so that we can see what you're calling in the #include's statements.

Author

Commented:
#include <oci.h>

#ifndef _COMMON_H
#include "Common.H"
#include <ctype.h>
#endif

Common.H includes the following header files....

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <strings.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#include <mqueue.h>
#include <termios.h>
#include <sys/mman.h>
#include <stropts.h>
#include <termios.h>
#include <time.h>
#include <poll.h>
#include <iostream.h>


//
//  Include files used for networking
//
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/select.h>

//
// Include file(s) for signal handling
//
#include <signal.h>
AxterSenior Software Engineer

Commented:
Try putting all your user #include files in the bottom and system #include files on the top.

Author

Commented:
#include <oci.h>

#ifndef _COMMON_H
#include "Common.H"
#include <ctype.h>
#endif

Common.H includes the following header files....

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <strings.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#include <mqueue.h>
#include <termios.h>
#include <sys/mman.h>
#include <stropts.h>
#include <termios.h>
#include <time.h>
#include <poll.h>
#include <iostream.h>


//
//  Include files used for networking
//
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/select.h>

//
// Include file(s) for signal handling
//
#include <signal.h>

Author

Commented:
Tried that but getting the same error...
Senior Software Engineer
Commented:
I see that you're using <iostream.h>

I think you're mixing *.h files with extensionless header files.

This could cause the type of error you're receiving.

Check all your code out, and make sure you're not using both types.

If you're, then you should either switch to extensionless header files, or remove any "using namespace std" statements.

Author

Commented:
Tried that but getting the same error...