Errors when compiling PHP source

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Suneo
Forum Newbie
Posts: 5
Joined: Thu Oct 30, 2003 7:27 pm

Errors when compiling PHP source

Post by Suneo »

When I try to compile php4 and php4dll I get the following errors.
I am compiling with VC++ .NET


------ Build started: Project: php4dll, Configuration: Debug Win32 ------

Compiling...
study.c
c:\PHPSOURCE\php-4.3.3\ext\pcre\pcrelib\internal.h(157) : fatal error C1189: #error : LINK_SIZE must be either 2, 3, or 4
pcre.c
c:\PHPSOURCE\php-4.3.3\ext\pcre\pcrelib\internal.h(157) : fatal error C1189: #error : LINK_SIZE must be either 2, 3, or 4
maketables.c
c:\PHPSOURCE\php-4.3.3\ext\pcre\pcrelib\internal.h(157) : fatal error C1189: #error : LINK_SIZE must be either 2, 3, or 4
get.c
c:\PHPSOURCE\php-4.3.3\ext\pcre\pcrelib\internal.h(157) : fatal error C1189: #error : LINK_SIZE must be either 2, 3, or 4

Build log was saved at "file://c:\PHPSOURCE\php-4.3.3\Debug\BuildLog.htm"
php4dll - 4 error(s), 0 warning(s)


------ Build started: Project: php4, Configuration: Debug Win32 ------

Linking...
LINK : fatal error LNK1104: cannot open file 'php4nts_debug.lib'

Build log was saved at "file://c:\PHPSOURCE\php-4.3.3\Debug\BuildLog.htm"
php4 - 1 error(s), 0 warning(s)


---------------------- Done ----------------------

Build: 3 succeeded, 2 failed, 0 skipped
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

the php4dllts.dsp isn't included in the vc6 workspace. Open, convert (to .vcproj) and save it. Then compare php4dllts.vcproj with php4dll.vcproj
Check the entry for <File RelativePath="..\ext\pcre\pcrelib\get.c"> and you will find that the preprocessor definition "LINK_SIZE=2" is missing for all pcre files :(
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

You should complain to the php quality assurance team about that. ;)
Suneo
Forum Newbie
Posts: 5
Joined: Thu Oct 30, 2003 7:27 pm

Post by Suneo »

I still can not figure out why I keep getting the link error that it cannot find the .lib...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

because of the errors when compiling the pcre-module php4nts_debug.lib can't be build. The next project (php.vcproj/.dsp) depends on this library.

Easiest way around is not to open and convert php4.dsw but php4ts.dsw
Post Reply