I tried using swig 2.0.12 to rebuild the wrappers but I’m still getting the same error. But it does seem te be on a different line this time. Here’s the build output and the fatal error when running the Optimizer test.
Modifying the ConvertTest.php also doesn’t seem to make a difference.
cmake28 -D BUILD_PDFNetPHP=ON …
– The CXX compiler identification is GNU 4.8.2
– Check for working CXX compiler: /opt/rh/devtoolset-2/root/usr/bin/c++
– Check for working CXX compiler: /opt/rh/devtoolset-2/root/usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Found SWIG: /usr/local/bin/swig (found version “2.0.12”)
– Using SWIG 2.0.12
– Using PHP include directories: -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
– Generating sources for PHP bindings using swig…
– Generating sources for PHP bindings using swig… OK
– Configuring done
– Generating done
– Build files have been written to: /home/unitrust/wrappers_build/PDFNetWrappers/Build
make
Scanning dependencies of target PDFNetPHP
[100%] Building CXX object PDFNetPHP/CMakeFiles/PDFNetPHP.dir/PDFNetPHP.cpp.o
Linking CXX shared module …/lib/PDFNetPHP.so
[100%] Built target PDFNetPHP
make install
[100%] Built target PDFNetPHP
Install the project…
– Install configuration: “”
– Installing: /home/unitrust/wrappers_build/PDFNetWrappers/PDFNetC/Lib/PDFNetPHP.php
– Installing: /home/unitrust/wrappers_build/PDFNetWrappers/PDFNetC/Lib/PDFNetPHP.so
– Removed runtime path from “/home/unitrust/wrappers_build/PDFNetWrappers/PDFNetC/Lib/PDFNetPHP.so”
Running the optimizer test:
PDFNet is running in demo mode.
PHP Fatal error: No matching function for overloaded ‘Optimizer_Optimize’ in /home/unitrust/wrappers_build/PDFNetWrappers/PDFNetC/Lib/PDFNetPHP.php on line 13865
PHP Stack trace:
PHP 1. {main}() /home/unitrust/wrappers_build/PDFNetWrappers/Samples/OptimizerTest/PHP/OptimizerTest.php:0
PHP 2. Optimizer::Optimize() /home/unitrust/wrappers_build/PDFNetWrappers/Samples/OptimizerTest/PHP/OptimizerTest.php:91
PHP 3. optimizer_optimize() /home/unitrust/wrappers_build/PDFNetWrappers/PDFNetC/Lib/PDFNetPHP.php:13865
Fatal error: No matching function for overloaded ‘Optimizer_Optimize’ in /home/unitrust/wrappers_build/PDFNetWrappers/PDFNetC/Lib/PDFNetPHP.php on line 13865
Call Stack:
0.0004 241152 1. {main}() /home/unitrust/wrappers_build/PDFNetWrappers/Samples/OptimizerTest/PHP/OptimizerTest.php:0
0.1688 6666016 2. Optimizer::Optimize() /home/unitrust/wrappers_build/PDFNetWrappers/Samples/OptimizerTest/PHP/OptimizerTest.php:91
0.1689 6666112 3. optimizer_optimize() /home/unitrust/wrappers_build/PDFNetWrappers/PDFNetC/Lib/PDFNetPHP.php:13865
Op donderdag 4 december 2014 20:59:14 UTC+1 schreef Ryan:
It definitely looks to be a problem with explictly declared OptimizerSettings class in the PDFNetPHP.i file. I suspect the latest SWIG 3.02 that you are using is not generating something compatible with our .i file anymore.
Can you please try the following.
- Modify the ConverTest.php so that it uses a settings object. For example
`
// Convert PDF document to HTML
echo``(``nl2br``(``"Converting PDF to HTML\n"``));
$outputFile
= ``$outputPath``.``"pdf2html"``;
$settings = new HTMLOutputOptions()
;
Convert::ToHtml(``$inputPath``.``"newsletter.pdf"``, ``$outputFile, $settings``);
echo``(``nl2br``(``"Saved "``.``$outputFile``.``"\n"``));
`
I suspect that this too will fail with the same error.
- Rebuild the wrapper, but using SWIG 2.0.12. I think this will fix the issue.
I see this comment on the SWIG 3.0.0 release announcement, which makes me suspicious.
- Nested class support added. This has been taken full advantage of in
Java and C#. Other languages can use the nested classes, but require
further work for a more natural integration into the target language.
We urge folk knowledgeable in the other target languages to step
forward and help with this effort.