Suddenly, "make" has stopped working: did not generate *.so php extension;
gcc has stopped working: did not find header files;
Visual studio code started showing problems: headers missing.
I have reinstalled: glibc, libc6-dev, build-essentials, gcc-multilib, and g++-multilib.
I have reinstalled Visual Studio Code for Linux Mint.
I have added the paths to configuration.json of Visual Studio ( settings-> search for c_cpp_confiuration.json or similar, or under settings-> c/c++ extensions ->configuration file )
{
"window.zoomLevel": -3,
"workbench.colorTheme": "Visual Studio Light - C++",
"editor.minimap.enabled": false,
"files.autoSave": "afterDelay",
"C_Cpp.default.browse.path": [],
"C_Cpp.default.compilerPath": "",
"C_Cpp.default.customConfigurationVariables": {},
"C_Cpp.default.defines": [],
"C_Cpp.default.includePath": [ "/usr/lib/gcc/x86_64-linux-gnu/9/include", "/usr/include", "usr/local/include", "/usr/include/php/20190902", "/usr/include/php/20190902/main", "/usr/include/php/20190902/Zend", "/usr/include/php/20190902/TSRM", "${workspaceRoot}", "$(VC_IncludePath)", "$(UniversalCRT_IncludePath)" ]
}
I have added the environmental variable C_INCLUDE_PATH
to
#/etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/drb/lampstack-7.4.11-0/.symfony/bin:/drb/lampstack-7.4.11-0/php/bin:";
C_INCLUDE_PATH="/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/include:usr/local/include:/usr/include/php/20190902:/usr/include/php/20190902/main:/usr/include/php/20190902/Zend:/usr/include/php/20190902/TSRM:"
I have rebooted the computer.
Visual Studio does not show problems.
But make
does not work ( does not show any errors, but does not produce php-extension.lo
and *.la
),
sudo make install does not work ( does not show any errors, but does not produce php-extension.so
)
and gcc
can not find header files.
made a simple shell script to set C_INCLUDE_PATH from project folder
#env.sh
#!/bin/bash
C_INCLUDE_PATH="/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/include:usr/local/include:/usr/include/php/20190902:/usr/include/php/20190902/main:/usr/include/php/20190902/Zend:/usr/include/php/20190902/TSRM:"
export C_INCLUDE_PATH
CPATH="/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/include:usr/local/include:/usr/include/php/20190902:/usr/include/php/20190902/main:/usr/include/php/20190902/Zend:/usr/include/php/20190902/TSRM:"
export CPATH
echo "set C_INCLUDE_PATH to"
printenv C_INCLUDE_PATH
but make
does not work and gcc
does not find headers.
Trying to set from command line
$ gcc -I "usr/include/php/201990902:/usr/include/php/20190902/main" tsub76.c
gives the same fatal error that header does not exist. Checking folder, the header exists as /usr/include/php/20190902/main/php.h
Where are the configuration files of gcc
and make
located to to set include path for headers ?