Click here to Skip to main content
16,016,022 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
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

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



C#
void StartCallback( void (* CALLBACK managedCallback(char **)))
{
        managedCallback1=managedCallback;

}

 void StopCallback( void (* CALLBACK managedCallback()))
{
        managedStopCallback=managedCallback;

}



How I can solve this
Posted
Updated 18-Jun-12 21:07pm
v2

1 solution

Should be:
C++
void (CALLBACK *managedCallback1)(char **);

void (CALLBACK *managedStopCallback)();

The extra asterisk before the open parenthesis is incorrect.
 
Share this answer
 
Comments
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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900