scorninpc / php-gtk3

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

Linux build fails #164

Open apss-pohl opened 2 months ago

apss-pohl commented 2 months ago

Hi, i just updated PHP-CPP to latest version and compiled it successfully. When i tried to compile php-gtk3 next i get this error, must not be php-cpp related at all - i didn`t compile on linux for a while..

image

scorninpc commented 2 months ago

I cannot do attention now, but i'll try this at home today

What php version are you trying?

is the php-cpp repo version?

apss-pohl commented 2 months ago

Yes, standard PHP-CPP and i compile for 7.4.33

scorninpc commented 2 months ago

I always use this repository to compile php 8 https://github.com/fast-debug/PHP-CPP.git

the original repository took many years to merge pull requests, so this guy just did these merges

on my first attempt to make the error occur, it did not occur, because I was using this repository

when I realized, I switched to the official repository, and the error started to occur

this makes me believe that at some point the original php-cpp changed something and caused php-gtk3 to break

Is it possible for you to test with this repository instead of the official one?

image

apss-pohl commented 2 months ago

Same here, it works with fast-debug ootb. I used to use this repo, too. Unfortunately it became stale, while there haven been changes in the original repo this year releasing version 2.4.3 (fast-debug: 2.3.5). It is very unsatisfying with PHP-CPP. For windows non of both works ootb and you need manual changes.

The issue seems to be here: https://github.com/CopernicaMarketingSoftware/PHP-CPP/blob/master/include/value.h#L59 Makes this unusable: https://github.com/scorninpc/php-gtk3/blob/master/main.cpp#L4384

I used ChatGPT to try to fix it but i could not find a solution. There are some more issues with other parts of the codebase i was able to find a solution (you can find the parts here: https://github.com/scorninpc/php-gtk3/commit/4ef223ef5811f54caf4a2d2a69299b0309d43bf3)

I also tried the windows build, which fails, too. Some constructors are missing int he current codebase, i opened a PR (https://github.com/scorninpc/php-gtk3/pull/165).

scorninpc commented 2 months ago

It's alot change, thank you

I'm going to this way to fix this problem too

apss-pohl commented 2 months ago

Let me know if i should open a PR for those fixes already. I will still not build using original PHP-CPP but it seems to work with fast-debug, too

scorninpc commented 2 months ago

You're doing a lot of return handling. My fear is that this is a lot more work than it needs to be. Doing this for every method would be a lot of work. I noticed that you've made a lot of casting changes, which may be a setting for the compiler version (or the version of C++) you're using. I'm trying to finish a virtual machine to do Windows compilation, and rewrite the documentation for it, so if you could put this aside for a while, that would be a good idea.

apss-pohl commented 2 months ago

Sure, let me know if i should open a PR at any time. Key problem is this guy:

https://github.com/CopernicaMarketingSoftware/PHP-CPP/blob/master/include/value.h#L59 Makes this unusable: https://github.com/scorninpc/php-gtk3/blob/master/main.cpp#L4384

If i comment this i can build the module but it is unusable.

scorninpc commented 2 months ago

Maybe guys on PHP-CPP can help. Try open a issue about that, what do you think?

apss-pohl commented 2 months ago

I am watching this repo and there is barely an answer, i dont expect his to happen. They will most likely state that we need to change our code

scorninpc commented 2 months ago

can you provide a .vsproject file and paths that you are using for php, php-cpp and php-gtk3? ou a zip "all-in-one"?

apss-pohl commented 2 months ago

Unfortunately ist most likely not gonna work, also my path are pretty different. Will sent you an email but might be tricky..

scorninpc commented 2 months ago

I'm very stucked on windows build

image

I've tested all forks and cannot compile on vs 2022 =/

apss-pohl commented 2 months ago

You can try may branch here: https://github.com/apss-pohl/PHP-CPP-win/tree/fork

And maybe switch to english, otherwise i cant help at all :)

subabrain commented 2 months ago

hello @ all,

i will do a vs project for you :)

EDIT: Give me a few hours ;)

EDIT: Should i do a complete new tutorial?

Regards Robert

scorninpc commented 2 months ago

I think my problem is with PHP 8.2.22

I done a env with 7.4 and all works fine

I think PHP-CPP become a pain ....

EDIT: Should i do a complete new tutorial?

if you, ok. Try to rename a new like windows.new.md

subabrain commented 2 months ago

Hi Bruno,

i will do it for 8.2 now :)

EDIT: There is also a Bug in PHP-CPP Code -> a Constructor is missing :/

OKAY - ITS Done soon - BUT one important thing ->you have to compile with Visual Studio 2017 (v141):

grafik

Regards Robert

subabrain commented 2 months ago

hi,

ok i got it - but i have big trouble with your pango implementation ... i dont get the lib from pango to run :/

Regards Robert

scorninpc commented 2 months ago

Pango is part of Gtk. On the first tutorial to compile on windows, it was already there

image

scorninpc commented 2 months ago

OKAY - ITS Done soon - BUT one important thing ->you have to compile with Visual Studio 2017 (v141):

VS 2019 142v works on php 7.4 =/

Anyway, if its compile, its ok ahahah

apss-pohl commented 2 months ago

I also build 7.4 with 2017- i can build with 2019 but this will not match the php version binaries provided in the web.

subabrain commented 2 months ago

Pango is part of Gtk. On the first tutorial to compile on windows, it was already there

image

Hi Bruno,

yes thats right but what i mean is this:

grafik

this is new :)

EDIT: IM SO SORRY - i didnt saw the Pango Folder inside the src folder of php-gtk3 - SORRY!

Regards Robert

subabrain commented 2 months ago

Hi there,

as Bruno said -> VS16 (Visual Studio 2019) is for newer PHP Versions (PHP >= 8.0) and VC15 is Visual Studio 2017.

i got it now to compile php-gtk3 in the newest version for PHP 8.2.0 :)

here the whole visual studio project (with all dependencies) for PHP 8.2.0 as onedrive link:

link

Have Fun!

Regards Robert

scorninpc commented 2 months ago

I don't know what kind of witchcraft you've been doing, but it worked perfectly hahahah

image

I'm using VS 2022 with 142v and works nicely

What php-cpp repository do you use?

I'll upload .sln to repository, and do a instructions what change on project to compile.

With this working, i'll release 1.0 version with linux and windows at the same version of php

Thank you alot guys

Edited: i confirm that problem is php-cpp. i've tried official one, apss-pohl and fast-debug, no one worked. After that i used robert's php-cpp inside zip and all works fine. Can you provide from where is your php-cpp?

apss-pohl commented 2 months ago

Edited: i confirm that problem is php-cpp. i've tried official one, apss-pohl and fast-debug, no one worked. After that i used robert's php-cpp inside zip and all works fine. Can you provide from where is your php-cpp?

My CPP repo works fine for PHP 7.4, and it worked all the time, sorry if i was unclear. My intention is to get it working with the official CPP but maybe thats not that easy

scorninpc commented 2 months ago

My CPP repo works fine for PHP 7.4, and it worked all the time, sorry if i was unclear.

No get me wrong Sven, you done/do a nice job. I always used your repo for 7.4 (Y)

My intention is to get it working with the official CPP but maybe thats not that easy

Yes, this will be nice to use some oficial, and alot people are trying to help, but the main dev of php-cpp does not accept help =/

Edited: this issue changed fast hahaha i'll open another one about windows compile, sorry. Lets get this issue for linux build with oficial php-cpp

Lets try this https://github.com/scorninpc/php-gtk3/discussions

subabrain commented 2 months ago

I don't know what kind of witchcraft you've been doing, but it worked perfectly hahahah

image

I'm using VS 2022 with 142v and works nicely

What php-cpp repository do you use?

I'll upload .sln to repository, and do a instructions what change on project to compile.

With this working, i'll release 1.0 version with linux and windows at the same version of php

Thank you alot guys

Edited: i confirm that problem is php-cpp. i've tried official one, apss-pohl and fast-debug, no one worked. After that i used robert's php-cpp inside zip and all works fine. Can you provide from where is your php-cpp?

Hello together,

to make something clear - if you compile with php 8 you have to be aware which compiler you choose -> otherwise it would compile but NOT run as extension -> so please use 142 here!

AND - Please use my Properties for compiling with PHP-CPP successful!

And - the PHP-CPP has many many Major Bugs in use for Windows, which i have fixed in the zip file -> so please take this one @apss-pohl -> please compare and update your sourcecode as needed.

@apss-pohl -> could you give me the errors from your windows build for PHP 8?

EDIT: I plan to make a new Version of PHP-CPP .lib/.dll -> so you dont have to worry about 😎

Regards Robert

apss-pohl commented 2 months ago

And - the PHP-CPP has many many Major Bugs in use for Windows, which i have fixed in the zip file -> so please take this one @apss-pohl -> please compare and update your sourcecode as needed.

I cant access the file, maybe you can sent it as email?

@apss-pohl -> could you give me the errors from your windows build for PHP 8?

I do not compile for PHP8 at all (we might migrate to php 8 someday but right now its out of scope).

EDIT: I plan to make a new Version of PHP-CPP .lib/.dll -> so you dont have to worry about 😎

Maybe we should have a GTK3 compatible fork of PHP-CPP?

subabrain commented 2 months ago

Hi Sven,

i would send you by mail, but its too big to send. - i would pack on my server - i will send you the link through mail ;)

EDIT: when i try to implement phpcpp as library in php-gtk3 project, then 8 linker errors accure:

grafik

i think there is a problem with import/export dll

Regards Robert