Skip to content
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

PHPCPP for Windows as .dll/.lib #104

Open
subabrain opened this issue Jun 26, 2024 · 22 comments
Open

PHPCPP for Windows as .dll/.lib #104

subabrain opened this issue Jun 26, 2024 · 22 comments

Comments

@subabrain
Copy link
Contributor

subabrain commented Jun 26, 2024

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
Copy link
Owner

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
Copy link
Contributor Author

subabrain commented Jun 27, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor Author

subabrain commented Jun 28, 2024

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
Copy link
Owner

And what are you doing?

@subabrain
Copy link
Contributor Author

subabrain commented Jun 28, 2024

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
Copy link
Contributor Author

subabrain commented Jun 30, 2024

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
Copy link
Owner

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
Copy link
Contributor Author

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

Regards
Robert

@subabrain
Copy link
Contributor Author

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

Regards
Robert

@scorninpc
Copy link
Owner

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

@apss-pohl
Copy link
Contributor

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
Copy link
Contributor Author

subabrain commented Jul 3, 2024

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
Copy link
Contributor

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
Copy link
Contributor Author

Hi,

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

Regards
Robert

@subabrain
Copy link
Contributor Author

Hi,

sorry i have to disappoint you ...

grafik

but i have a plan b 😄

Regards
Robert

@scorninpc
Copy link
Owner

i never understand this c errors in windows hhahahha

still not working?

@subabrain
Copy link
Contributor Author

subabrain commented Jul 7, 2024

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
Copy link
Contributor Author

subabrain commented Jul 7, 2024

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

Thanks and Regards!
Robert

@scorninpc
Copy link
Owner

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
Copy link
Contributor Author

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
Copy link
Contributor

Just a hint @subabrain i forgot about this one.
Windows compile causes currently issues: #81
I reverted to revert this for compilation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants