tryphotino / photino.Native

https://tryphotino.io
Apache License 2.0
131 stars 47 forks source link

Error execution after successful compilation of arm64 #109

Closed anan1213095357 closed 9 months ago

anan1213095357 commented 1 year ago

symbol lookup error: /home/orangepi/linux-arm64/Photino.Native.so: undefined symbol: _ZN13PhotinoDialogC1Ev

anan1213095357 commented 1 year ago

If I compile on Linux x86, I will also have this issue. May I ask how to solve this problem?

philippjbauer commented 1 year ago

After you compile Photino.Native you need to build your .NET app and move the binary into the bin/Debug/net6.0/runtimes/linux-arm64 and then start the app without building it again dotnet run --no-build. (see attached screenshot)

We noticed that the last release of Photino.Native unfortunately didn't include the binary for Linux ARM64 and will replace it with a package that does include it.

We don't support x86 platforms and have not tested them. The same method might apply here as well.

Screenshot 2023-05-18 at 9 52 08 AM
13474657423 commented 11 months ago

1.在运行Photino例子程序时,出现以下问题:

在ubuntu系统上运行正常,但是发布为arm64程序并在嵌入式arm64系统开发板是总是提示 Unable to load shared library 'Photino.Native' or one of its dependencies 我的解决办法是: 根据提示是Photino.Native.so文件的问题,然后使用file Photino.Native.so查看文件。我的提示 root@ok3568:~/blazor/linux-arm64# file Photino.Native.so Photino.Native.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=9252f20a763f988ffb41c32a11f25b2747a74239, not stripped
从返回的信息中可以看出此库位X64系统的库,于是就到官网下载了源代码,然后拷贝到arm64开发板使用makefile进行编译。具体步骤: 1.将下载的源代码文件拷贝到arm64开发板中 2.打开终端定位到photino.Native-2.4.1目录下,因为文件已经编译好了makefile文件直接使用make命令执行。具体命令如下 root@ok3568:~/photino.Native-2.4.1# make linux-arm64 3.编译时出错,提示错误: ./Photino.Native/Photino.Linux.cpp: In constructor ‘Photino::Photino(PhotinoInitParams*)’: ./Photino.Native/Photino.Linux.cpp:161:74: warning: comparison with string literal results in unspecified behavior [-Waddress] 161 | if (initParams->WindowIconFile != NULL && initParams->WindowIconFile != "") 从结果看是代码问题,就使用vi命令进入到代码将 && initParams->WindowIconFile != ""删除。然后再使用 make linux-arm64命令编辑就成功了。

4.使用file Photino.Native.so查看文件 root@ok3568:~/blazor/linux-arm64# file Photino.Native.so Photino.Native.so: ELF 64-bit LSB shared object, ARM arrch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=9252f20a763f988ffb41c32a11f25b2747a74239, not stripped
说明此时生成的库为arm64系统的库,将此库拷贝到程序文件中,然后运行程序。 注意:因为其依赖webkit2gtk如果没有此库需要运行sudo apt-get update && sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev 备注:photino.Native-2.4.1下载地址https://codeload.github.com/tryphotino/photino.Native/zip/refs/tags/v2.4.1

philippjbauer commented 9 months ago

Hello @anan1213095357!

We just released Photino.NET v2.5.0. This includes pre-compiled Photino.Native libraries for ARM64 operating systems including Linux. I tested this version successfully on the latest Debian version.

I'll close this issue for now, assuming this will work for you. But please let us know about your experience!