ircmaxell / FFIMe

A FFI Wrapper library and header parser!
MIT License
138 stars 5 forks source link

Unable to locate header files #11

Closed Cvar1984 closed 2 years ago

Cvar1984 commented 4 years ago
<?php

require __DIR__ . '/vendor/autoload.php';

$prefix = '/data/data/com.termux/files/usr';

$libcurl = (new FFIMe\FFIMe($prefix . '/lib/libcurl.so'))
        ->include($prefix . '/include/curl/url.h')
        ->build();
/data/data/com.termux/files/home/ffi/vendor/ircmaxell/php-c-parser/lib/PreProcessor.php:250:
array(3) {
  [0] =>
  string(18) "/usr/local/include"
  [1] =>
  string(12) "/usr/include"
  [2] =>
  string(29) "/usr/include/x86_64-linux-gnu"
}

Fatal error: Uncaught LogicException: Could not find header file: /data/data/com.termux/files/usr/include/curl/url.h given context  (called from ) in /data/data/com.termux/files/home/ffi/vendor/ircmaxell/php-c-parser/lib/PreProcessor.php on line 251

LogicException: Could not find header file: /data/data/com.termux/files/usr/include/curl/url.h given context  (called from ) in /data/data/com.termux/files/home/ffi/vendor/ircmaxell/php-c-parser/lib/PreProcessor.php on line 251

Call Stack:
    0.0008     370680   1. {main}() /data/data/com.termux/files/home/ffi/main.php:0
    0.3565     703608   2. FFIMe\FFIMe->include() /data/data/com.termux/files/home/ffi/main.php:8
    0.3566     703608   3. PHPCParser\CParser->parse() /data/data/com.termux/files/home/ffi/vendor/ircmaxell/ffime/lib/FFIMe.php:101
    0.3723     706984   4. PHPCParser\PreProcessor->process() /data/data/com.termux/files/home/ffi/vendor/ircmaxell/php-c-parser/lib/CParser.php:22
    0.3724     706984   5. PHPCParser\PreProcessor->findAndParse() /data/data/com.termux/files/home/ffi/vendor/ircmaxell/php-c-parser/lib/PreProcessor.php:27
    0.3724     706984   6. PHPCParser\PreProcessor->findHeaderFile() /data/data/com.termux/files/home/ffi/vendor/ircmaxell/php-c-parser/lib/PreProcessor.php:189
cayolblake commented 2 years ago

@Cvar1984 found a way around this?

bwoebi commented 2 years ago

I cannot reproduce the issue, except for the fact that current versions of curl do not have a url.h, only a urlapi.h.

bwoebi commented 2 years ago

I managed to reproduce the issue (bad include_next handling), it's fixed by now.