php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42252 Windows compile failure with mbstring and zend_multibyte
Submitted: 2007-08-09 03:11 UTC Modified: 2007-08-30 03:45 UTC
From: okabe at zend dot co dot jp Assigned: hirokawa (profile)
Status: Closed Package: Compile Failure
PHP Version: 4.4.7 OS: Windows 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: okabe at zend dot co dot jp
New email:
PHP Version: OS:

 

 [2007-08-09 03:11 UTC] okabe at zend dot co dot jp
Description:
------------
I want to build php4.4.7 with mbstring and zend multibyte because to use Japanese character set that is called "Shift_JIS".

I am able to build normal win32's php.exe (have no mbstring) using php4ts.dsw by following the php manual.

Then, at first, I add lines to config.w32.h as follows...
---
#define ZEND_MULTIBYTE 1
#define HAVE_MBSTRING 1
#define HAVE_MBREGEX  1
#define HAVE_MBSTR_CN 1
#define HAVE_MBSTR_JA 1
#define HAVE_MBSTR_KR 1
#define HAVE_MBSTR_RU 1
#define HAVE_MBSTR_TW 1
#define MBSTRING_EXPORTS 1
#undef COMPILE_DL_MBSTRING
---

and I add line to zend_config.w32.h as follows...
---
#define ZEND_MULTIBYTE 1
---

next,

I added source files about under ext/mbstring to php4dllts.dsp.
(making mbstring folder in Function Modules and import those files and folders)

next,

I built the project, and watching the include errors.
This work was repeated and the path of the include error was corrected.

Finally, 

four errors C2099(initializer is not a constant.) and much warnings C4013(undefined; assuming extern returning int) and C4273(inconsistent dll linkage. dllexport assumed.) remained.
---
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(783) : warning C4013:
:
:
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfilter.c(110) : warning C4273: 'mbfl_buffer_converter_new' :
:
:
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_convert.c(214) : error C2099: 
:
:
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_encoding.c(119) : error C2099:
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_encoding.c(121) : error C2099:
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_encoding.c(131) : error C2099:
---

Then, what should I do?
I'm using VC6.

Actual result:
--------------
build message is follows...

---
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(783) : warning C4013: '_mbschr' undefined; assuming extern returning int
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(784) : warning C4013: '_mbscspn' undefined; assuming extern returning int
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(785) : warning C4013: '_mbsnbcat' undefined; assuming extern returning int
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(786) : warning C4013: '_mbsnbcpy' undefined; assuming extern returning int
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(787) : warning C4013: '_mbspbrk' undefined; assuming extern returning int
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(788) : warning C4013: '_mbsrchr' undefined; assuming extern returning int
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\tchar.h(789) : warning C4013: '_mbsspn' undefined; assuming extern returning int
 :
omit
 :
--------------------configure: php4dllts - Win32 Release_TS--------------------
Generating ext/standard/parsedate.c
compiling resource...
compiling...
 :
omit
 :
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfilter.c(110) : warning C4273: 'mbfl_buffer_converter_new' : inconsistent dll linkage. dllexport assumed.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfilter.c(154) : warning C4273: 'mbfl_buffer_converter_delete' : inconsistent dll linkage. dllexport assumed.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfilter.c(169) : warning C4273: 'mbfl_buffer_converter_reset' : inconsistent dll linkage. dllexport assumed.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfilter.c(175) : warning C4273: 'mbfl_buffer_converter_illegal_mode' : inconsistent dll linkage. dllexport assumed.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfilter.c(191) : warning C4273: 'mbfl_buffer_converter_illegal_substchar' : inconsistent dll linkage. dllexport assumed.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfilter.c(207) : warning C4273: 'mbfl_buffer_converter_strncat' : inconsistent dll linkage. dllexport assumed.
 :
omit
 :
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_convert.c(100) : warning C4273: 'mbfl_convert_filter_list' : inconsistent dll linkage. dllexport assumed.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_convert.c(214) : error C2099: initializer is not a constant.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_convert.c(225) : warning C4273: 'mbfl_convert_filter_new' : inconsistent dll linkage. dllexport assumed.
 :
omit
 :
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_encoding.c(119) : error C2099: initializer is not a constant.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_encoding.c(121) : error C2099: initializer is not a constant.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_encoding.c(131) : error C2099: initializer is not a constant.
C:\work\php-4.4.7\ext\mbstring\libmbfl\mbfl\mbfl_encoding.c(187) : warning C4273: 'mbfl_name2encoding' : inconsistent dll linkage. dllexport assumed.
 :
omit


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-11 03:23 UTC] hirokawa@php.net
I think that MBFL_DLL_EXPORT is undefined on compile option.
Please try again with '/D "MBFL_DLL_EXPORT"'.


 [2007-08-14 11:04 UTC] okabe at zend dot co dot jp
Thank you for your reply!

I tried to add '/D "MBFL_DLL_EXPORT"' to php4dllts.
The building is advance from before.

However link error is generated.
----
..\ext\mbstring\mbregex\COPYING.LIB : fatal error LNK1136: file is not available or be destroied.
link.exe have execution error.
----

And, I disabled file to build from project as follows:
..\ext\mbstring\mbregex\COPYING.LIB

but a lot of link errors were generated.

Do you have any idea?
 [2007-08-17 23:05 UTC] hirokawa@php.net
Did you added COPYING as  build files ?
You should add *.c *.h only.

 [2007-08-20 06:05 UTC] okabe at zend dot co dot jp
Hirokawa-san,
Thank you a lot!

The situation progressed by building according to your advice.
php4dllts left three following link errors.

---
Linking...
   Creating library ..\Release_TS/php4ts.lib and object ..\Release_TS/php4ts.exp 
mbfl_encoding.obj : error LNK2001: unresolved external symbol "_strcasecmp"
mbfl_language.obj : error LNK2001: unresolved external symbol "_strcasecmp"
..\Release_TS\php4ts.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

php.exe - 3 error(s), 89 warning(s)
---

I am looking at the next file, is this help me?
php-x.x.x\ext\mbstring\libmbfl\config.h.vc6
 [2007-08-29 13:11 UTC] hirokawa@php.net
You should'nt define HAVE_STRCASECMP if you don't have
strcasecmp().
For Visual C++, you should use stricmp instead of strcasecmp().
You should check your compile option.


 [2007-08-29 13:15 UTC] hirokawa@php.net
The compile option is incorrect for this author.
So, it is not a bug.

 [2007-08-30 03:45 UTC] okabe at zend dot co dot jp
Hirokawa-san,

I succeeded!
Thank you very much for your teaching.

It was only a problem of the compile option. Since it did not generate at the time of dll creation, I have not noticed.

I appreciate cooperation deeply.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC