Error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'

When compiling a C program in LINUX, I get foll. Error:

stream.h:1123: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
stream.h:1124: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'mblk_t'
stream.h:1125: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'mblk_t'

Lines 1123, 112, and 1125 are shown below:

__STREAMS_EXTERN int adjmsg(mblk_t *mp, register ssize_t length);
__STREAMS_EXTERN mblk_t *allocb(size_t size, unsigned int priority);
__STREAMS_EXTERN mblk_t *copyb(register mblk_t *mp);

Program C includes a header file, which in turn includes stream.h Any idea how this can be resolved?

+3
source share
3 answers

This is not entirely clear the context of your code, but it seems to me that you are using the OpenSSL library (or you are copying and pasting from this source code).

The macro is streams_fastcalldefined in the header file kmem.h. Did you turn it on? If you just copy and paste, you just need to add these lines before the definition STREAMS_EXTERN:

#ifndef streams_fastcall
#if defined __i386__ || defined __x86_64__ || defined __k8__
#define streams_fastcall __attribute__((__regparm__(3)))
#else
#define streams_fastcall
#endif
#endif

: streams_fastcall Microsoft Specific ( Windows) __fastcall. , , regparm, , , , __fastcall ( , ! lol)

+1

, __STREAMS_EXTERN , .

__STREAMS_EXTERN?

+1

If the error is not related to the absence; or a similar syntax error in your code, check for a bad openSSL link.

Your openSSL includes err.h and evp.h in / opt / openssl / include / openssl, and you compile directives that are -I. -L / opt / openssl / lib, -l crypto and -l dl

with this inclusion in your .h file, it causes an error: #include (the same with err.h).

Just replace it with inclusion: #include to solve it.

0
source

All Articles