Re: [INTERNALS-WIN] Developing PHP extensions on Windows with VC++, linking problems

[email protected] (Eugenio Tacchini)
Newsgroups php.internals.win
Message-ID <[email protected]>
At 08.26 11/05/2009 +0200, Kalle Sommer Nielsen wrote:
 >2009/5/10 Eugenio Tacchini <[email protected]>:
 >>
 >> I then execute nmake but I get this error:
 >> internal_functions.c
 >> main\internal_functions.c(43) : error C2065: 'phpext_my_extension_ptr' :
 >> undeclared identifier
 >> main\internal_functions.c(43) : error C2099: initializer is not a constant
 >>
 >> I don't have any idea about the cause...
 >
 >Thats because your header file does not define the module pointer,
 >checkout any extension and you should see something like:
 >
 >extern zend_module_entry <myext>_module_entry;
 >#define phpext_<myext>_ptr &<myext>_module_entry

Hello Kalle,
thanks for your reply.
My header file, stdafx.h, just contains these lines:

#pragma once

// Include the Zend Win32 header and the general PHP header
#include "zend_config.w32.h"
#include "php.h"

so, the only thing I have to do is to add
extern zend_module_entry my_extension_module_entry;
#define phpext_my_extension_ptr &my_extension_module_entry

at the end of the file?

Thanks.

Eugenio
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.