Error while compiling php-cpp main.cpp file

180 views Asked by At

I'm using php-cpp to create an extension for my php codes and when I try to compile just the simple structure of main.cpp file, I get this error.this is the compile errors:

main.cpp:15:5: error: ‘PHPCPP_EXPORT’ does not name a type
 PHPCPP_EXPORT void *get_module() 

and this is the code that I try to compile:

extern "C" {
int main(){}    

PHPCPP_EXPORT void *get_module() 
{
    static Php::Extension myExt("myExt", "0.9.3.20");        
    return myExt;
}
}
1

There are 1 answers

0
Amir On BEST ANSWER

You have missed the #include <phpcpp.h> command.