Robby Robby
Robby Robby

Reputation: 3

Compiler error for dll import c++/MFC

I have an MFC project that imports a C type DLL for use. This code worked fine when my project was in V 6.0, but after transferring the code to v2010 and adding some .NET code to the project(using \clr) that section of my code has started throwing compiler errors about missing ")" and ";". I have been researching all morning but I have not been able to come up with a solution. Can anyone please help me?

Below is the line section of code throwing the compiler error:

 #ifdef __cplusplus
  extern "C" __declspec(dllimport) void _stdcall KILLIT();
  extern "C" __declspec(dllimport) void _stdcall MAINDLL(char *PATH,int PATHLEN,char      *SUBDIR,int SUBDIRLEN, char *NAME,
int NAMELEN,char *HOMEDIR,int HOMEDIRLEN,char *ARCHDIR,int ARCHDIRLEN, int *FUN,int   *VERSION,int *BUS,int *PJMPV,
int *NFLAG,int *RETERROR);

#endif

These are the compiler errors I get:

DSAANA.cpp(32): error C2143: syntax error : missing ')' before 'constant'
>DSAANA.cpp(32): error C2143: syntax error : missing ';' before 'constant'
>DSAANA.cpp(34): error C2059: syntax error : ')'

I will appreciate any help I can get

Thanks Robby

Upvotes: 0

Views: 375

Answers (1)

Joseph Willcoxson
Joseph Willcoxson

Reputation: 6040

Would be helpful if you added line numbers to each line so we know what is what. Might be a name conflict with a macro in one of the headers. For your function declarations, you could remove variable names and just have the variable types. If that fixes one of the errors, slowly add your old variable names back in until you get the error again and you will find the conflict.

Upvotes: 1

Related Questions