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

Can't add some extra libraries to the application #531

Closed
kartaris opened this issue Feb 19, 2021 · 17 comments
Closed

Can't add some extra libraries to the application #531

kartaris opened this issue Feb 19, 2021 · 17 comments
Assignees
Labels
Awaiting This task depends on the other not QuasarApp task. Bug Something isn't working Windows Windows version
Milestone

Comments

@kartaris
Copy link
Contributor

I have a problem to start my application on Windows because it needs libEGL, libGLESv2 and d3dcompiler libraries(the screenshot below).

image

I tried to add them myself. Just copied them to the application folder and application started.

The problem:
I haven't found correct way to add libraries(libEGL, libGLESv2, d3dcompiler*) as extra libraries.
I used commands like(with many variations):

  • cqtdeployer deploySystem extractPlugins -extraLibs EGL,GLESv2,d3dcompiler -bin $${BINPATH} -qmake $${QMAKE_EXECUTABLE} -qmlDir $${QMLPATH} -targetDir $${TARGETDIR} clear
  • cqtdeployer deploySystem extractPlugins -extraLibs EGL,GLESv2,d3dcompiler,libEGL,libGLESv2,d3dcompiler_47,egl,glesv2,libegl,libglesv2 -bin $${BINPATH} -qmake $${QMAKE_EXECUTABLE} -qmlDir $${QMLPATH} -targetDir $${TARGETDIR} clear
  • cqtdeployer deploySystem extractPlugins -libDir $${PATHTOLIBS} -extraLibs EGL,GLESv2,d3dcompiler,libEGL,libGLESv2,d3dcompiler_47,egl,glesv2,libegl,libglesv2 -bin $${BINPATH} -qmake $${QMAKE_EXECUTABLE} -qmlDir $${QMLPATH} -targetDir $${TARGETDIR} clear

Non of them helped. Also I tried adding path to to the libraries by setting PATH variable(just for the cqtdeployer's command session) and it doesn't work too.
I don't know if there is a bug but it looks like a bug.

PS: HanoiTowers application can't start on my PC because of the same problem.

@EndrII EndrII self-assigned this Feb 19, 2021
@EndrII EndrII added Bug Something isn't working Windows Windows version labels Feb 19, 2021
@EndrII
Copy link
Member

EndrII commented Feb 19, 2021

hmm.
show me please your DistributionKit folder
and what version are you using?

@kartaris
Copy link
Contributor Author

kartaris commented Feb 19, 2021

Forgot to add information about toolkit. I use Qt 5.15.2 MinGW 32-bit. And cqtdeployer 1.5

@EndrII
Copy link
Member

EndrII commented Feb 19, 2021

You can install opengl driver in your PC. it is should be resolve you trouble.

i faced similar problem,

The main solution to the problem is to install the driver.
The described libraries in the message are stubs that simply redirect gl requests to the processor and "angle" windows driver.
If you are using qml as the QML inside a QQuickWidget then most likely you will need to use a driver anyway. Throwing in these libraries can only help if you are using a pure qml application without the Widgets wrapper.

As for the fact that the distribution does not have these libraries, then this is a bug of the cqtdeployer, I will double-check their availability now. If we confirm that they were not added, we will correct it.

@EndrII EndrII added this to the v1.5 milestone Feb 19, 2021
@EndrII
Copy link
Member

EndrII commented Feb 19, 2021

@kartaris yes. I am confirm this is a bug of The CQtdeployer.

Trouble in the parsing pe files. I think than The CQtDeployer do not search delay-loaded libraries.

@pzhlkj6612 maybe you know how to parse PE delay-loaded libraries?

@kartaris
Copy link
Contributor Author

@EndrII
Oh. I thought extraLibs key should search libraries in environment paths. Just checking the name pattern and arch compatibility.

@EndrII
Copy link
Member

EndrII commented Feb 19, 2021

@EndrII
Oh. I thought extraLibs key should search libraries in environment paths. Just checking the name pattern and arch compatibility.

No The extraLibs option allows you to copy the required system libraries with an appropriate name.

Provided that they are required for your application.

The error lies in the fact that the PE parser could not determine the dependencies due to the fact that they are loaded deferred with the first call of their functions and not at the start of the application.

If you want to force copy this libs use the bin option or the extraData option
example

cqtdeployer -bin my.exe,path/to/EGL.dll,path/to/GLESv2.dll,path/to/d3dcompiler_47.dll

or

cqtdeployer  -bin my.exe -extraData path/to/EGL.dll,path/to/GLESv2.dll,path/to/d3dcompiler_47.dll -extraDataOut path/myLibraryDir

The extraDataOut option is optional because The Windows distribution kit collect libraries in to root folder.

@kartaris
Copy link
Contributor Author

@EndrII
Oh. I thought extraLibs key should search libraries in environment paths. Just checking the name pattern and arch compatibility.

No The extraLibs option allows you to copy the required system libraries with an appropriate name.

Provided that they are required for your application.

The error lies in the fact that the PE parser could not determine the dependencies due to the fact that they are loaded deferred with the first call of their functions and not at the start of the application.

If you want to force copy this libs use the bin option or the extraData option
example

cqtdeployer -bin my.exe,path/to/EGL.dll,path/to/GLESv2.dll,path/to/d3dcompiler_47.dll

or

cqtdeployer  -bin my.exe -extraData path/to/EGL.dll,path/to/GLESv2.dll,path/to/d3dcompiler_47.dll -extraDataOut path/myLibraryDir

The extraDataOut option is optional because The Windows distribution kit collect libraries in to root folder.

Great! I will use the solution as a temporary hack.

@EndrII
Copy link
Member

EndrII commented Feb 19, 2021

@kartaris Thanks you for bug report.

@pzhlkj6612
Copy link
Collaborator

maybe you know how to parse PE delay-loaded libraries?

Well, for now I have no idea about that.

@EndrII
Copy link
Member

EndrII commented Feb 19, 2021

maybe you know how to parse PE delay-loaded libraries?

Well, for now I have no idea about that.

when i'm free from other projects i will take on this task

@pzhlkj6612
Copy link
Collaborator

maybe you know how to parse PE delay-loaded libraries?

@EndrII Hi. Did you inspect the dependency tree of that program which needs the three dlls (EGL.dll GLESv2.dll d3dcompiler_47.dll) with lucasg/Dependencies ? Are they all delay-loaded?

@EndrII
Copy link
Member

EndrII commented Feb 22, 2021

maybe you know how to parse PE delay-loaded libraries?

@EndrII Hi. Did you inspect the dependency tree of that program which needs the three dlls (EGL.dll GLESv2.dll d3dcompiler_47.dll) with lucasg/Dependencies ? Are they all delay-loaded?

No, but
I have encountered this problem in webengine before, I even had to hardcode these cqtdeployer libraries so that they would be copied into the distribution, provided that the program depends on webengine. Then I decided that they are loaded as plugins and are not marked anywhere in the Dll. Now I understand that PE has delay load libraryes and they are marked somewhere in the PE file, unlike classic plugins.

@pzhlkj6612
Copy link
Collaborator

Maybe you mean "run-time load library" instead of "delay-loaded library"?

As Linker support for delay-loaded DLLs | Microsoft Docs said, delay-loading uses the technology of run-time loading, and they are not the same.

@EndrII
Copy link
Member

EndrII commented Feb 22, 2021

i mean that the run-time load library is plugin
and delay-loaded library is run-time load library that marked in the import table and possible to the extract from PE file.
Microsoft docs have a instruction for extracting list of delay-loaded libraries

@pzhlkj6612
Copy link
Collaborator

Yes, "DUMPBIN" can do this work.

@EndrII
Copy link
Member

EndrII commented Feb 22, 2021

Yes, "DUMPBIN" can do this work.

DUMPBIN uses system function of the window, it sucks because it breaks our parsing on Linux and the planned Mac OS.

We need to use the PE parser lib for this.
See PE-parser issue

@EndrII EndrII modified the milestones: v1.5, v1.6 Mar 30, 2021
@EndrII EndrII modified the milestones: v1.5, v1.6 Oct 18, 2022
@EndrII EndrII added the Awaiting This task depends on the other not QuasarApp task. label Nov 3, 2022
@EndrII
Copy link
Member

EndrII commented Aug 15, 2023

@kartaris
On the new cqtdeployer you can add custom dependencies manually.
Using the extraDepends option
it should solve this issue. So I close it.

@EndrII EndrII closed this as completed Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting This task depends on the other not QuasarApp task. Bug Something isn't working Windows Windows version
Projects
None yet
Development

No branches or pull requests

3 participants