Click here to Skip to main content
11,637,176 members (69,178 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ C Linux QT

I am creating one shared library in Linux using Qt and C as programming language. When i compile my code it show me one error like this

expected ‘)’ before ‘*’

/home/arun/Documents/sFlowAnalyzingSampleInC#/sFlowLib/sFlowLib-build-desktop-Qt_4_8_2_in_PATH__System__Release/../sFlowLib/src/sflowtool.c:432: error: expected ‘)’ before ‘*’ token

/home/arun/Documents/sFlowAnalyzingSampleInC#/sFlowLib/sFlowLib-build-desktop-Qt_4_8_2_in_PATH__System__Release/../sFlowLib/src/sflowtool.c:4467: error: expected ‘)’ before ‘managedCallback’

And my code is

void *(  CALLBACK *managedCallback1)(char **);
       void *(  CALLBACK *managedStopCallback)();

void StartCallback( void (* CALLBACK managedCallback(char **)))
 void StopCallback( void (* CALLBACK managedCallback()))

How I can solve this
Posted 18-Jun-12 20:56pm
Edited 18-Jun-12 21:07pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Should be:
void (CALLBACK *managedCallback1)(char **);
void (CALLBACK *managedStopCallback)();
The extra asterisk before the open parenthesis is incorrect.
Arun Kumar K S at 19-Jun-12 3:54am
still same problem exist
Richard MacCutchan at 19-Jun-12 4:04am
Look at the other block of code posted above, you seem to be adding your indirection operators anywhere at random.
Arun Kumar K S at 19-Jun-12 3:58am
This is my running code on Visual studio. Its working perfectly on mu visual studio but not in Linux
Richard MacCutchan at 19-Jun-12 4:03am
I find that hard to believe.
Arun Kumar K S at 19-Jun-12 6:02am
I compiled it by removing CALLBACK but that not worked wirth my mono application as a callback
Richard MacCutchan at 19-Jun-12 7:55am
What is CALLBACK defined as?
Arun Kumar K S at 20-Jun-12 6:22am
#define CALLBACK __stdcall
its a calling convetion
Arun Kumar K S at 20-Jun-12 6:54am
Thanks to your help I solved it by removing CALLBACK and my running code is

void *( *managedCallback1)(char **);
void *( *managedStopCallback)();
Arun Kumar K S at 20-Jun-12 6:57am
My 5 to your valuable support
Richard MacCutchan at 20-Jun-12 9:11am
Happy to help & glad you got it solved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 295
1 295
2 stibee 288
3 himanshu agarwal 184
4 Sergey Alexandrovich Kryukov 184
0 OriginalGriff 9,031
1 Sergey Alexandrovich Kryukov 8,513
2 Mika Wendelius 6,922
3 F-ES Sitecore 2,388
4 Suvendu Shekhar Giri 2,320

Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 19 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100