Pelles C forum

C language => Beginner questions => Topic started by: whatsup on July 05, 2010, 12:22:57 PM

Title: whats the problem with this code ? + (does pelles knows C++ ?)
Post by: whatsup on July 05, 2010, 12:22:57 PM
hey every body
1. i took this code from a header file,
and i get a syntex error on pellesc,
can someone tell me whats the problem and how to fix it.

Code: [Select]
#define WIN32
#define VSTCALLBACK __cdecl
typedef int VstInt32; ///< 32 bit integer type
typedef VstInt32 VstIntPtr;

struct AEffect;

typedef VstIntPtr (VSTCALLBACK *audioMasterCallback) (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);


2. i have a cpp app, does pelles knows to compile cpp files ?

thanks in advanced.
Title: Re: whats the problem with this code ? + (does pelles knows C++ ?)
Post by: Stefan Pendl on July 05, 2010, 12:44:28 PM
2. i have a cpp app, does pelles knows to compile cpp files ?

Pelles C is ANSI C only, for C++ you need to use a different compiler.
Title: Re: whats the problem with this code ? + (does pelles knows C++ ?)
Post by: whatsup on July 06, 2010, 06:09:57 AM
ok, thanks.
Title: Re: whats the problem with this code ? + (does pelles knows C++ ?)
Post by: Stefan Pendl on July 06, 2010, 08:18:37 AM
For your first question, can you attach the complete project?
Title: Re: whats the problem with this code ? + (does pelles knows C++ ?)
Post by: TimoVJL on July 06, 2010, 09:29:06 AM
1. Perhaps change
Code: [Select]
struct AEffect;to forward declaration
Code: [Select]
typedef struct AEffect AEffect;
Title: Re: whats the problem with this code ? + (does pelles knows C++ ?)
Post by: whatsup on July 06, 2010, 03:28:04 PM
thank you tim, that was it.

the project is C++, and now i understand that pellesc doesn't know this language,
so i gaveup from it for c++.

(maybe in the future i will be able to convert it to C)