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

From: Date: Mon, 11 May 2009 06:55:07 +0000
Subject: Re: [INTERNALS-WIN] Developing PHP extensions on Windows with VC++, linking problems
References: 1 2 3 4 5 6 7 8  Groups: php.internals.win 
Request: Send a blank email to internals-win+get-479@lists.php.net to get a copy of this message
At 08.26 11/05/2009 +0200, Kalle Sommer Nielsen wrote:
2009/5/10 Eugenio Tacchini <eugenio@favoriti.it>:
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

« previous php.internals.win (#479) next »