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

PHPCPP for Windows as .dll/.lib

Open subabrain opened this issue 1 year ago • 22 comments

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

subabrain avatar Jun 26 '24 20:06 subabrain

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

scorninpc avatar Jun 27 '24 12:06 scorninpc

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 avatar Jun 27 '24 19:06 subabrain

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 avatar Jun 28 '24 13:06 subabrain

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

subabrain avatar Jun 28 '24 16:06 subabrain

And what are you doing?

scorninpc avatar Jun 28 '24 17:06 scorninpc

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 avatar Jun 28 '24 23:06 subabrain

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

subabrain avatar Jun 30 '24 14:06 subabrain

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?

scorninpc avatar Jun 30 '24 18:06 scorninpc

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

Regards Robert

subabrain avatar Jun 30 '24 19:06 subabrain

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

Regards Robert

subabrain avatar Jul 01 '24 19:07 subabrain

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

scorninpc avatar Jul 01 '24 22:07 scorninpc

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

apss-pohl avatar Jul 02 '24 07:07 apss-pohl

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 ;)

subabrain avatar Jul 03 '24 12:07 subabrain

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

apss-pohl avatar Jul 04 '24 13:07 apss-pohl

Hi,

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

Regards Robert

subabrain avatar Jul 04 '24 13:07 subabrain

Hi,

sorry i have to disappoint you ...

grafik

but i have a plan b 😄

Regards Robert

subabrain avatar Jul 06 '24 22:07 subabrain

i never understand this c errors in windows hhahahha

still not working?

scorninpc avatar Jul 07 '24 18:07 scorninpc

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 avatar Jul 07 '24 18:07 subabrain

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

Thanks and Regards! Robert

subabrain avatar Jul 07 '24 19:07 subabrain

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

scorninpc avatar Jul 08 '24 00:07 scorninpc

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

subabrain avatar Jul 08 '24 13:07 subabrain

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

apss-pohl avatar Jul 10 '24 09:07 apss-pohl