scorninpc / php-gtk3

GTK3 extension for PHP
https://andor.com.br/
GNU Lesser General Public License v3.0
114 stars 11 forks source link

PHPCPP for Windows as .dll/.lib #104

Open subabrain opened 3 months ago

subabrain commented 3 months ago

Hello together,

after the Release of my compiled Version of PHP-CPP for Windows, i have a little Problem now. PHPCPP is working very well but in compiling with PHP-GTK 3, there is some strange thing i doenst figure out.

Maybe you can help me here - its a linker Problem - with this:

1>main.obj : error LNK2001: Unresolved external symbol "const Php::Value::`vftable'" (??_7Value@Php@@6B@).
1>main.obj : error LNK2001: Unresolved external symbol "public: __cdecl Php::Value::Value(void const *)" (??0Value@Php@@QEAA@PEBX@Z).
1>main.obj : error LNK2001: Unresolved external symbol "const Php::File::`vftable'" (??_7File@Php@@6B@).
1>php-gtk.obj : error LNK2001: Unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > Php::warning" (?warning@Php@@3V?$basic_ostream@DU?$char_traits@D@std@@@std@@A).
1>GtkSourceView.obj : error LNK2001: Unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > Php::deprecated" (?deprecated@Php@@3V?$basic_ostream@DU?$char_traits@D@std@@@std@@A).
1>C:\phpcpp_master\phpcpp - Copy\x64\Release\phpgtk3.dll : fatal error LNK1120: 5 unresolved externals.

If you know why - it would be cool if you can share - thx!

Regards Robert

scorninpc commented 3 months ago

Hello Robert

This is a link error, maybe phpcpp path error? or something?

Or you missing some error. In my experience, maybe missing libgtksourceview and GtkSouceView cannot be compiled?

try to look all log

subabrain commented 3 months ago

Hi Bruno,

yes i found it has to be in the streams.h/streams.cpp File - ill try to get this :)

Thanks and Regards! Robert

subabrain commented 3 months ago

okay - now just 3 :)


1>main.obj : error LNK2001: unresolved external symbol "const Php::Value::`vftable'" (??_7Value@Php@@6B@)".
1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl Php::Value::Value(void const *)" (??0Value@Php@@QEAA@PEBX@Z)".
1>main.obj : error LNK2001: unresolved external symbol "const Php::File::`vftable'" (??_7File@Php@@6B@)".
1>D:\phpcpp_new\visu_php-gtk3\x64\Release\visu_php-gtk3.dll : fatal error LNK1120: 3 unresolved externals
1>The build of project "visu_php-gtk3.vcxproj" has been completed -- FAILED.

Try to check out :)

Regards Robert

subabrain commented 3 months ago

ok only 2 :)

1>   Creating library "D:\phpcpp_new\visu_php-gtk3\x64\Release\visu_php-gtk3.lib" and object "D:\phpcpp_new\visu_php-gtk3\x64\Release\visu_php-gtk3.exp".
1>main.obj : error LNK2001: unresolved external symbol ""const Php::Value::`vftable'" (??_7Value@Php@@6B@)".
1>main.obj : error LNK2001: unresolved external symbol ""public: __cdecl Php::Value::Value(void const *)" (??0Value@Php@@QEAA@PEBX@Z)".
1>D:\phpcpp_new\visu_php-gtk3\x64\Release\visu_php-gtk3.dll : fatal error LNK1120: 2 unresolved externals
scorninpc commented 3 months ago

And what are you doing?

subabrain commented 3 months ago

And what are you doing?

oh ... i didnt know it by myself - its very hard im just experimenting - maybe i will do a complete new tutorial - lets have a look 😆

gn8 😎

PS: Before i forget - one error left ......

subabrain commented 3 months ago

Hello together,

ok i figured out the phpcpp is compiled and linked correct - the Problem is the implementation for phpcpp in phpgtk3.

i can compile phpcpp without errors and of course i can compile the phpgtk3 dependencies.

but not the main.cpp as itself.

Because of the __declspec(dllimport) Constant: "PHPCPP_EXPORT".

So in my opinion you should compile php-gtk3 complete with all files there are needed in one visual studio project.

Therefor i will do a new tutorial - but the phpcpp is also compiled and you can use for other applications.

BUT: If you have an Idea let me know 🙂

have a nice day and regards! Robert

scorninpc commented 3 months ago

i didn't see any change on phpcpp that needs change on phpgtk, it's very strange

maybe @apss-pohl can help with some tests on windows?

subabrain commented 3 months ago

ok but for windows it s a bit different .. i try to make a workaround 😎

Regards Robert

subabrain commented 3 months ago

okay - i will fix the stuff in the phpcpp there is no other workaround ...

Regards Robert

scorninpc commented 3 months ago

Robert, wouldn't it be possible for this error to occur due to the version of PHP or PHPCPP?

apss-pohl commented 3 months ago

Hi, sorry coming in late, what exactly is the issue? I am compiling for windows quite nice.. bu ti might use an older version of PHP-CPP, i notice some recent changes in the repo. I am using this: https://github.com/apss-pohl/PHP-CPP-win

subabrain commented 3 months ago

Hi together,

okay - once again: i compiled phpcpp as .lib/.dll for windows without errors.

But if i try to use it with phptk3 there are some errors ...... dont know why .... but it can be of the constant for dllimport/dllexport ....

here a shot: Screenshot 2024-07-03 150753

Maybe you could help me here ... thx a lot!

Regards Robert

PS: I used the actual master branch of phpcpp .... and also the status quo of the php-gtk3 ;)

apss-pohl commented 3 months ago

Can you try my repo? Also i never compiled php8 but only 7.4, could also make a difference? I am afaraid to break my setup when i move over

subabrain commented 3 months ago

Hi,

yes of course the PHP Version could be the reason - ill check this :)

Regards Robert

subabrain commented 2 months ago

Hi,

sorry i have to disappoint you ...

grafik

but i have a plan b 😄

Regards Robert

scorninpc commented 2 months ago

i never understand this c errors in windows hhahahha

still not working?

subabrain commented 2 months ago

ok,

i think its misunderstanding - if you put all files in one project - then it works ..... because of dll - i dont see another good opportunity.

grafik

grafik

but i will do a new tutorial + php 8 and 7 support of php-gtk3 😉

Have a nice time!

Regards Robert

subabrain commented 2 months ago

@scorninpc Bruno - is it ok for you if i do a new repository for php-gtk3 under windows?

Thanks and Regards! Robert

scorninpc commented 2 months ago

Robert, i think it's better to maintain one repo only. Its a big problem of open source. Alot forks and some point projects stop update.

I always mention you guys, and if you want I'd love to release .zip of windows binaries.

But... its your decision =)

anyway, i'll release a new version. What PHP version are you using? to release same version on windows and linux

subabrain commented 2 months ago

Hi,

sorry for the delay :P

ok - you are right - we should keep it together.

maybe we can provide windows php 8 and php 7 as .zip files in your repo ;)

Have a nice Time!

Regards Robert

apss-pohl commented 2 months ago

Just a hint @subabrain i forgot about this one. Windows compile causes currently issues: https://github.com/scorninpc/php-gtk3/issues/81 I reverted to revert this for compilation