Click here to Skip to main content
11,933,037 members (60,582 online)
Rate this:
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 21:56pm
Edited 18-Jun-12 22: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 19-Jun-12 3:54am
still same problem exist
Richard MacCutchan 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 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 19-Jun-12 4:03am
I find that hard to believe.
Arun Kumar K S 19-Jun-12 6:02am
I compiled it by removing CALLBACK but that not worked wirth my mono application as a callback
Richard MacCutchan 19-Jun-12 7:55am
What is CALLBACK defined as?
Arun Kumar K S 20-Jun-12 6:22am
#define CALLBACK __stdcall
its a calling convetion
Arun Kumar K S 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 20-Jun-12 6:57am
My 5 to your valuable support
Richard MacCutchan 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.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