0

I want to compile extension for PHP under Windows and I need to run such command:

g++ `php-config --includes` -fPIC -c some_script.cpp

but when I run this command I received an error:

g++: error: `php-config: No such file or directory
g++: error: unrecognized option '--includes`'

where can I get php-config shell script without recompiling PHP (under Windows)

1 Answer 1

1

The problem is not that you don't have the script, it's that the Windows shell doesn't know what you're trying to do because it doesn't support backticks. The command wants to run the php-config script and include the output in the command, but instead g++ is being passed \php-configas the first argument, and--includes`` as the second argument, which are not valid arguments to GCC.

You can't run a UNIX shell command in Windows. Either use a UNIX-style shell (e.g. via Cygwin or Mingw32) or just use a different command, e.g. figure out what the necessary include flags are and use them:

g++ -I/some/path -fPIC -c some_script.cpp
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.