php-gtk3 icon indicating copy to clipboard operation
php-gtk3 copied to clipboard

phpcpp and php-gtk3 with mingw

Open subabrain opened this issue 4 years ago • 30 comments

Hello together,

i have a problem when compiling phpgtk3 with mingw from debian - the code of phpgtk3 works to compile but if its compiling the phpcpp lib there are some strange errors:

/usr/i686-w64-mingw32/include/phpcpp/inivalue.h:17:21: error: variable ‘Php::PHPCPP_EXPORT Php::IniValue’ has initializer but incomplete type class PHPCPP_EXPORT IniValue

... and so on ....

Does somebody know whats this Problem?

Greets Robert

subabrain avatar May 10 '20 13:05 subabrain

Ok i think its not a Problem with phpgtk3 more than a Problem with MinGW and PHP-CPP ...

subabrain avatar May 10 '20 15:05 subabrain

Any php extensions with MinGW is a problem. If you compile PHP-CPP you can compile PHP-GTK3

scorninpc avatar May 11 '20 13:05 scorninpc

okay - today i will try again to compile to windows :)

subabrain avatar Oct 15 '20 11:10 subabrain

Nice!

But i'm working on a generated code, non dependency, new code

https://github.com/scorninpc/php-gtk4

With this we'll compile natively on windows, without dependencies, and will support gtk 3 and gtk 4. So i'm unmaintenancing this repo (php-gtk3) for now

scorninpc avatar Oct 15 '20 13:10 scorninpc

ah ok - great :)

tried now ... but i got it working with linux but its a bit hard to get it with the mingw compiler under debian ...

greets

subabrain avatar Oct 15 '20 21:10 subabrain

mingw is a problem as I said. You will not get this work with mingw

https://stackoverflow.com/questions/3711327/how-do-you-compile-a-php-extension-on-windows-with-cygwin-mingw

You really need VS to compile PHP-CPP on windows, and then compile PHP-GTK easy

scorninpc avatar Oct 16 '20 01:10 scorninpc

hello

okay - ill try this :)

subabrain avatar Oct 16 '20 21:10 subabrain

Hi there,

i think its easier than expected. Just had to modify the makefile to create .dll files - but i just have to test ...

Greets Robert

subabrain avatar Oct 01 '21 12:10 subabrain

hi boys and girls,

i finaly get php-cpp compile under cygwin ... with cmake ... and now i want to integrate it in the llibs ...

edit: okay i got the phpcpp.dll.a now - its a step further now :)

thanks a lot! Robert

subabrain avatar Oct 02 '21 13:10 subabrain

Nice to know @subabrain. What do you want now? just add php-gtk lib on cmake list of libs when compile PHP source and do the compile to see the errors of the lib now.

Make a "HOW TO" compile the php-cpp, to others try compile it too, and mabe i can help more =)

scorninpc avatar Oct 03 '21 21:10 scorninpc

Hi,

okay - i thought it was wrong - just get the phpcpp-common .dll file but not the real phpcpp project...

so i get phpcpp it in an .a file (that works) ... i try now to compile it from cmake / visual studio ... but i think there are some code errors -> maybe im wrong - but i believe that here is c/c++ mixed in one file ...

i will try further ...

Greets Robert

subabrain avatar Oct 05 '21 10:10 subabrain

Hi,

okay - i got now the phpcpp-common.lib compiled -> with visual studio. Do i have to load this .lib for compiling the main phpcpp?

would be nice if you could answer ....

Greets Robert

subabrain avatar Oct 08 '21 06:10 subabrain

You need the phpcpp.dll to compile php-gtk

scorninpc avatar Oct 08 '21 19:10 scorninpc

Hi,

yes i know - but could i do it with the following:

make the .a file so its a static lib of phpcpp - then compile phpgtk3 with this .a file ...... then compile the .so from phpgtk3 to .dll??

greets Robert

subabrain avatar Oct 11 '21 16:10 subabrain

Oh Robert, I would really like to help, but I don't know anything about windows

scorninpc avatar Oct 11 '21 18:10 scorninpc

Hi,

okay - i see.... i figured out that it is because of the php-cpp files which are stored in the zend folder ... so now i hope i can make a .dll of the .o and phpcpp lib - will try after work :)

stay tuned!

Greets Robert

subabrain avatar Oct 13 '21 07:10 subabrain

okay - the release is near :)

edit: with wsl ... :)

Greets Robert

subabrain avatar Oct 14 '21 12:10 subabrain

Okay,

i have the .dll of phpcpp now .... now just compile phpgtk3 :)

Greets Robert

subabrain avatar Dec 17 '21 20:12 subabrain

Nice, you can share the dll? or the code to compile?

scorninpc avatar Dec 21 '21 14:12 scorninpc

Hi,

sorry the .dll is corrupt :(

i try to make a mingw 32 bit version - i hope it will be working :)

ITS NOT EASY - BUT I GOT VERY FAR :)

Greets Robert

subabrain avatar Dec 22 '21 10:12 subabrain

okay,

i think its ok now - but one missing .dll:

2022-01-03 00_00_55-Dependencies (x64)

maybe someone could help :)

GN8!

subabrain avatar Jan 02 '22 23:01 subabrain

I would really like to be helping you, but for over 10 years I haven't opened a windows. the last version I saw was NT

scorninpc avatar Jan 07 '22 19:01 scorninpc

😄

subabrain avatar Jan 08 '22 12:01 subabrain

Ok,

if somebody can speak German - this is the link to my describtion how make dlls under Ubuntu:

https://burncycle.de/2022/01/06/dll-von-cpp-datei-unter-linux-erstellen/

(sorry page at the moment not reachable - fix it soon)

Greets Robert

subabrain avatar Jan 22 '22 14:01 subabrain

okay,

i think i have the solution.

just do something like this:

https://stackoverflow.com/questions/9360280/how-to-make-a-lib-file-when-have-a-dll-file-and-a-header-file

on my dll file :)

then run in visual studio with this combination of lib / dll files.

Greets Robert

subabrain avatar Mar 22 '22 13:03 subabrain

@subabrain, and if we create a docker? it can run on mac and windows without problems and dependencies

scorninpc avatar May 05 '22 13:05 scorninpc

hmm - i dont think so ..... i try it once again today evenening .... if it not works i will do it maybe a docker ...

Greets Robert

subabrain avatar May 05 '22 15:05 subabrain

Nice to ear that. But i'm seen a lot people with problem to compile anything about PHP on windows 10 and 11. Anyway, i'll try to do some little tests with docker and will post here

scorninpc avatar May 05 '22 16:05 scorninpc

hi,

sorry for the long delay -> i will compile php-cpp with cmake for windows and then i compile with visual studio php-gtk3 :)

Greets Robert

subabrain avatar Jul 29 '22 11:07 subabrain

ok,

i got the lib/dll now for windows from phpcpp :)

here:

https://github.com/CopernicaMarketingSoftware/PHP-CPP/issues/443

now itry to compile phpgtk 3 with viusal studio :)

Greets Robert

subabrain avatar Aug 01 '22 14:08 subabrain