Bug #61177 [Asn->Opn]: Unable to compile when including sapi/embed/php_embed.h

From: Date: Tue, 24 Oct 2017 07:35:36 +0000
Subject: Bug #61177 [Asn->Opn]: Unable to compile when including sapi/embed/php_embed.h
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212119@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61177&edit=1

 ID:                 61177
 Updated by:         kalle@php.net
 Reported by:        jmc at chakra-project dot org
 Summary:            Unable to compile when including
                     sapi/embed/php_embed.h
-Status:             Assigned
+Status:             Open
 Type:               Bug
 Package:            Compile Failure
 Operating System:   Windows XP Professional SP3
 PHP Version:        5.3.10
-Assigned To:        pajoye
+Assigned To:        
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2012-03-11 15:28:37] jmc at chakra-project dot org

PHP was built as non-thread safe, and I haven't manually redefined the ZTS macro, so I bet
it's not the case.

I've given up on the embedding way for now, and I'm using PHP as an external interpreter,
FWIW.

------------------------------------------------------------------------
[2012-03-05 00:34:54] johannes@php.net

That error indicates you're most likely mixing a thread-safe PHP build with a non-thread safe
build. (PHP build thread-safe, your application expecting a non-threaded PHP build)

I'm not sure how this is supposed to work on Windows, though. Maybe Pierre has some tips. On
Linux/Unix the generated php_config.h has the proper settings.

------------------------------------------------------------------------
[2012-03-03 02:16:04] jmc at chakra-project dot org

"Solved" that problem by including <math.h> before any PHP header, so that those
functions will not get redefined. Also found out that PHP messes up with the "inline"
keyword, so it won't play well with Qt headers when they are included after the PHP ones.

Seems like the only remaining problem is now this linkage failure:

Window.cpp.obj : error LNK2001: unresolved external symbol __imp__executor_globals

But I'm lost now.

------------------------------------------------------------------------
[2012-03-02 22:17:16] jmc at chakra-project dot org

It turns out that the problem is the same as described into this bug report:

https://bugs.php.net/bug.php?id=39130

Manually defining the _USE_32BIT_TIME_T macro at compile time allowed me to get 
past that error.

Something is still off, anyway, since I now get errors like these:

Window.cpp.obj : error LNK2005: _acosl already defined in PhpEmbed.cpp.obj
Window.cpp.obj : error LNK2005: _asinl already defined in PhpEmbed.cpp.obj
Window.cpp.obj : error LNK2005: _atanl already defined in PhpEmbed.cpp.obj
Window.cpp.obj : error LNK2005: _atan2l already defined in PhpEmbed.cpp.obj
...

and so on, seemingly caused by the functions defined in the php_math.h header in 
some way.

------------------------------------------------------------------------
[2012-02-24 12:01:49] jmc at chakra-project dot org

Yes, I've tried to change the #include directive like this:

extern "C" {
    #include <sapi/embed/php_embed.h>
}

and it gave me the same results.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=61177


--
Edit this bug report at https://bugs.php.net/bug.php?id=61177&edit=1


Thread (10 messages)

« previous php.bugs (#212119) next »