Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C Linux QT
Hi,
 
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 **)))
{
        managedCallback1=managedCallback;
 
}
 
 void StopCallback( void (* CALLBACK managedCallback()))
{
        managedStopCallback=managedCallback;
 
}
 

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

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
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 390
1 Jochen Arndt 150
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,260


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 19 Jun 2012
Copyright © CodeProject, 1999-2014
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