-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php-gtk3 for windows #24
Comments
Hey Robert. You are doing a lot nice work, thank you What the problem or error? i dont have any windows machine that can i install and help, but i can try help if you show some erros and processes Thank you |
Hi, i dont have problems with the libraries (i get them from vcpkg) - but with compiling errors ... i also tried to add the header files from glib/gtk/gdk and so on ... i will post the exact errors here later ... Greets |
why c++ has no types? everything is c++ C has no classes, so C is out of possible I'm compiling with standard 11. can this be the problem? i think visual studio has 17 as default, if i'm not wrong Try to add edit: |
hi, i think you misunderstood - i get this errors when compiling with the c / c++ language ... but i will try one thing - i will report here .... Greets |
hi, you cant compile gtk with g++ - you must compile as c here is the c++ workaround: https://www.gtk.org/docs/language-bindings/cpp please help here! Greets |
This is not workaround, this is a language bind for C++, as there is a language bind for python, Go and more. The PHP-GTK is not a bind of GTKMM, this is a bind on GTK =) Please, try provide your environment. What compiller, what steps, what erros ..... |
hi, i fully agree :) Greets |
Hi there, ok - i think i figured out ... it has to do with the glib dependencies ... maybe someone could help / explain me what to do? Greets |
The better way to try, maybe be do some simple projects with GTK, without PHP, to know dependencies of GTK on windows. After you compile a simple hello world with GTK, you know dependencies, and can add this to PHP-GTK |
Hi, okay - its a good way :) i will try later :) Greets |
Hi, ok, im very far now ... maybe one question: where is the type "GType" defined? i searched but its not working .... with the: #include "glib/gtypes.h" Greets |
Where did you use GType? https://github.com/GNOME/glib/blob/1d7dfb68e8e31ad0f1d682626b7a37ff9a7dc512/gobject/gtype.h |
ah ok This is defined on gtk.h , that include gobject.h, that include gtype.h That's why i'm suspecting that your environment is missing something |
hi, okay - i think i got it now ... just compile it like this: https://www.proggen.org/doku.php?id=c:tutorial:libraries:visualstudio then just add the .dll of phpcpp to your project and then compile with visual studio :) Greets |
hi, for all others - the problem was the glib dependencies in visual studio ... this helps a lot: http://www.tarnyko.net/dl/gtk.htm Greets |
Now just put the parts together for phpgtk 📦 Greets |
ok -i got to compile but im linking at the moment :P (i try to make 64 bit) :) Greets |
ok - i will post today evening the .dll ... and an explanation how to compile with visual studio :) EDIT: Sorry i have problems with 64 bit - i will do 32 ;) Greets |
thats run a simple gtkwindow? =D veeeery nice |
what you mean exactly? Greets |
did you compiled and run any php-gtk test? its working? |
EDIT: It compiles and links correct but i have problems to get it to run as extension ....... you can compile/link yourself -> all you need is msys2 and a working sourcecode version of phpcpp like posted above by y´myself .... Good Luck! I will let you know if it works :P Greets |
hi, ok - i got it but i dont see any window :P - tell me please if this is maybe because of the php version? i took php 7.4.0? Greets |
i need to see your php code to tell something to you when you run |
Very nice! i'll create a VM this weekend to test this. If you provide the steps to compile, i'll update documentation and try compile too Thank you for your perseverance =D |
Hi Bruno, ok .. i will do it later ;) Greets |
Hi, can i make a repository for phpgtk3 (windows) with visual studio here at github? thanks a lot! Greets |
i think we need use the same, for the updates fork and do a PR with your changes |
hi, ok - i see - we will do :) Greets |
Ok here, a little Tutorial about Compiling PHP-GTK3 for Windows with Visual Studio :) Please give Response :) Greets |
Robert, you do a nice work I'll translate it to here ok? |
its ok ;) Greets |
This a lot work hahaha https://github.com/scorninpc/php-gtk3/blob/master/docs/compile-windows.md Now i'll make a Windows VM to test your .zip file |
Ok, good luck! - please dont forget to install the redists ... Greets |
Ok, EDIT: You must copy these files from the msys "bin" folder to your PHP binary root folder:
Greets |
Hi, okay - please try this one: https://1drv.ms/u/s!AifVi84AXOwIhZR28F7EKuSOFAsuFg?e=uiPT5S Thanks! Merry Christmas! PS: @scorninpc please tell me if its working for you now ... thx! |
Yes, it's working
Ok, i've updated the documentation I found a little problem with pixbuf icons and images I think the problem 1 are that cannot find stock icons. Try to run this example The second problem, i dont know why, PHP cannot find my image This is the example i'm running <?php
Gtk::init();
function GtkWindowDestroy($widget=NULL, $event=NULL)
{
Gtk::main_quit();
}
echo "\n\n";
echo getcwd() . "\n";
echo "\n\n";
echo system('dir') . "\n";
echo "\n\n";
$win = new GtkWindow();
$win->set_default_size(300, 200);
$win->connect("destroy", "GtkWindowDestroy");
$img = GtkImage::new_from_file("C:\\Users\\admin\\Desktop\\examples\\twitter.png");
$btn = new GtkButton("Tw");
$btn->set_image($img);
$win->add($btn);
$win->show_all();
Gtk::main(); Anyway, you dont know how i'm happy to run a example on windows hahahah |
Hi, ok i see ... i will have a look! EDIT: Ok i found something in the header file: gdk-pixbuf-transform.h - i will have a look .... give me some time ;) -> Ok i found it - the placement of the "glibconfig.h" was not in the "glib" folder .... i think we have to update the tutorial again 😄 Greets |
I think that are 2 problems 1 - I dont know why it cannot find my image For the first one, i really dont understand. I've done all tests I can, but no success For second, maybe add the icons anywhere and add it to path, maybe works. I'll do a installer after package are OK, so dont worry with that "manual action" ok? EDIT:
Sorry, i didn't see this =D |
👍 👍 👍 |
Hi, ok - please add your adjustments to the Tutorial and please update - to put the file "glibconfig.h" from the folder "mingw64\lib\glib-2.0\include" to the folder "mingw64\include\glib-2.0". And update the Preprocessor to:
Thanks a lot! Greets |
Hello @ALL, i saw, that there is a folder needed - the name is "share" and it is located in the root dir of php ... i packed now all together so this version should work for you :) https://1drv.ms/u/s!AifVi84AXOwIhZR53jkm-y4JrCYkoA?e=HchNmt Have Fun! Notice: Please tell me if its working for you all 😃 Greets |
Where i can put this on the tutorial? |
hi, ok try this one: https://1drv.ms/u/s!AifVi84AXOwIhZR7hxFQVXNOWa-WRA?e=2SXQt8 Greets |
yes just put it there as first point (GTK Dependencies) .... thx! Greets |
Appear to be ok
Ok, updated Can I add this build to be downloaded on release page? Another question: its easy to try with PHP 8.1.14? maybe some PR of PHP-CPP needed to be merged manually, but you think its can be done? if its a problem for you, I'll try to follow the steps |
Hi, yes of course you can add this build 👍 yes its possible to do with PHP 8 - but you have to compile it new with the sources and binaries for PHP 8. i will have a look :) Greets |
Nice Robert So I think i'll close this issue, and open another for PHP 8.1 ok? Now we have a official windows package =) Thank you alot |
Hi, yes of course ;) Greets |
Hey there,
i got to compile phpcpp as a .lib / .dll file for windows.
here a link to the solution:
CopernicaMarketingSoftware/PHP-CPP#443
i am trying to compile php-gtk3 now with visual studio and phpcpp ..
But it is not very easy :/
Maybe someone could help - thanks a lot!
Greets
Robert
The text was updated successfully, but these errors were encountered: