build with static Qt missing library
-
wrote on 3 May 2023, 23:31 last edited by mzimmers 5 Apr 2023, 15:58
Hi all -
I've built a static version of Qt, and built my application with it. On my system, it works: I can pull it out of the build directory, double click on it, and it opens fine. So, I thought I had the problem solved. BUT: when I shared this file with someone else, he got an error message about "libgcc_s_seh-1.dll was not found."
This has me confused on a couple of levels:
- Why is my (supposedly) self-contained image looking for a .dll in the first place?
- I'm using the Qt-provided MinGW toolchain, so why is it looking for a gcc library?
I imagine this is all due to some mistake I made, but I'm not sure what additional information to provide. Can someone provide some insight?
EDIT: I found on this page that the configure command for the Qt build should include a "-no-exceptions" switch. I didn't do that (I've never done that in the past). According to the fine print at the bottom of the page, that page was last edited over 5 years ago, so I don't know whether that's still relevant.
EDIT again: the "-no-exceptions" modifier was rejected by my configure attempt.
Thanks...
-
Hi all -
I've built a static version of Qt, and built my application with it. On my system, it works: I can pull it out of the build directory, double click on it, and it opens fine. So, I thought I had the problem solved. BUT: when I shared this file with someone else, he got an error message about "libgcc_s_seh-1.dll was not found."
This has me confused on a couple of levels:
- Why is my (supposedly) self-contained image looking for a .dll in the first place?
- I'm using the Qt-provided MinGW toolchain, so why is it looking for a gcc library?
I imagine this is all due to some mistake I made, but I'm not sure what additional information to provide. Can someone provide some insight?
EDIT: I found on this page that the configure command for the Qt build should include a "-no-exceptions" switch. I didn't do that (I've never done that in the past). According to the fine print at the bottom of the page, that page was last edited over 5 years ago, so I don't know whether that's still relevant.
EDIT again: the "-no-exceptions" modifier was rejected by my configure attempt.
Thanks...
Lifetime Qt Championwrote on 4 May 2023, 15:51 last edited by Christian Ehrlicher 5 Apr 2023, 15:52@mzimmers said in build with static Qt missing library:
Why is my (supposedly) self-contained image looking for a .dll in the first place?
Because this is a dependency of gcc/mingw for exception handling as you already found out.
I'm using the Qt-provided MinGW toolchain, so why is it looking for a gcc library?
MinGW = gcc on windows
-
@mzimmers said in build with static Qt missing library:
Why is my (supposedly) self-contained image looking for a .dll in the first place?
Because this is a dependency of gcc/mingw for exception handling as you already found out.
I'm using the Qt-provided MinGW toolchain, so why is it looking for a gcc library?
MinGW = gcc on windows
wrote on 4 May 2023, 16:01 last edited by@Christian-Ehrlicher said in build with static Qt missing library:
Because this is a dependency of gcc/mingw for exception handling as you already found out.
Right, but why is it trying to use a .dll (instead of a static library)? Here's my configure command:
configure.bat -opensource -confirm-license -static -static-runtime -release -platform win32-g++ -opengl desktop -skip qtwebengine -nomake examples -nomake tests -Wno-dev -prefix c:\qt\6.5.0_static
Note the -static and -static-runtime options. This used to work. The various docs for building Qt on Windows are of varied currency, so I'm not sure which one to believe, but do you see anything in my command that I'm doing wrong?
Thanks...
-
@Christian-Ehrlicher said in build with static Qt missing library:
Because this is a dependency of gcc/mingw for exception handling as you already found out.
Right, but why is it trying to use a .dll (instead of a static library)? Here's my configure command:
configure.bat -opensource -confirm-license -static -static-runtime -release -platform win32-g++ -opengl desktop -skip qtwebengine -nomake examples -nomake tests -Wno-dev -prefix c:\qt\6.5.0_static
Note the -static and -static-runtime options. This used to work. The various docs for building Qt on Windows are of varied currency, so I'm not sure which one to believe, but do you see anything in my command that I'm doing wrong?
Thanks...
There is nothing wrong but afaik you have to create a static version of the missing library by yourself or simply distribute it. Don't know why all want a static version of Qt though...
-
There is nothing wrong but afaik you have to create a static version of the missing library by yourself or simply distribute it. Don't know why all want a static version of Qt though...
wrote on 4 May 2023, 16:27 last edited by@Christian-Ehrlicher you may be right, but I never had to do that in the past.
Regarding the necessity of a static build...currently my application is in the demo stage. Various people would like to see it. Giving them a single (.exe) file is the simplest way to accomplish this. Distributing the various gcc files with it could be cumbersome.
-
@Christian-Ehrlicher said in build with static Qt missing library:
Because this is a dependency of gcc/mingw for exception handling as you already found out.
Right, but why is it trying to use a .dll (instead of a static library)? Here's my configure command:
configure.bat -opensource -confirm-license -static -static-runtime -release -platform win32-g++ -opengl desktop -skip qtwebengine -nomake examples -nomake tests -Wno-dev -prefix c:\qt\6.5.0_static
Note the -static and -static-runtime options. This used to work. The various docs for building Qt on Windows are of varied currency, so I'm not sure which one to believe, but do you see anything in my command that I'm doing wrong?
Thanks...
wrote on 4 May 2023, 18:01 last edited by JoeCFD 5 Apr 2023, 18:03@mzimmers libgcc_s_seh-1.dll is not a part of Qt. Although you built a static Qt, it does not mean you built your app or Qt with a static gcc_s_seh-1. Check the dependencies of libgcc_s_seh-1.dll and wrap it with its app. Or find a static libgcc_s_seh-1 to build your app or Qt.
-
@mzimmers libgcc_s_seh-1.dll is not a part of Qt. Although you built a static Qt, it does not mean you built your app or Qt with a static gcc_s_seh-1. Check the dependencies of libgcc_s_seh-1.dll and wrap it with its app. Or find a static libgcc_s_seh-1 to build your app or Qt.
wrote on 4 May 2023, 23:08 last edited by@JoeCFD I'm not disagreeing with you, but my point is, the steps I'm following used to produce a standalone image. So, either something has changed in the build procedure, or I'm doing something wrong with my current project settings.
@Christian-Ehrlicher may have a valid point, about the appropriateness of this effort. Maybe I should look into an installer. It's just that this was relatively easy in the past.
-
There is nothing wrong but afaik you have to create a static version of the missing library by yourself or simply distribute it. Don't know why all want a static version of Qt though...
wrote on 5 May 2023, 07:23 last edited by@Christian-Ehrlicher said in build with static Qt missing library:
Don't know why all want a static version of Qt though...
DLLs is too much trouble for inhouse development as well as distribution. Our software consists of several individual programs. Sometimes our clients just swap out a single executable for a newer version. We used to have our GUI application written in wxWidgets which had a separate resource file. Just having two files that needed to be on the same version was too much hassle. Some would even have two different versions of the executable, but both would reference the same resource file. With changes inside the resource file (which contains menus and dialogs) only one of them would run properly. The same version mismatch can happen with DLLs.
For inhouse development it is a problem with DLLs because the developer machines (only two) have slightly different configurations. We need two different sets of DLLs based on who compiled the software. This makes it harder to just swap something on the other computers of our non-developing users.
The same applies to Linux where we are now using AppImages because otherwise library incompatibilities might arise.
Always assume the dumbest user possible. Then, a single file solution will save you a lot of headaches.
-
@Christian-Ehrlicher said in build with static Qt missing library:
Don't know why all want a static version of Qt though...
DLLs is too much trouble for inhouse development as well as distribution. Our software consists of several individual programs. Sometimes our clients just swap out a single executable for a newer version. We used to have our GUI application written in wxWidgets which had a separate resource file. Just having two files that needed to be on the same version was too much hassle. Some would even have two different versions of the executable, but both would reference the same resource file. With changes inside the resource file (which contains menus and dialogs) only one of them would run properly. The same version mismatch can happen with DLLs.
For inhouse development it is a problem with DLLs because the developer machines (only two) have slightly different configurations. We need two different sets of DLLs based on who compiled the software. This makes it harder to just swap something on the other computers of our non-developing users.
The same applies to Linux where we are now using AppImages because otherwise library incompatibilities might arise.
Always assume the dumbest user possible. Then, a single file solution will save you a lot of headaches.
wrote on 4 Jul 2023, 21:14 last edited byMarking this as solved, not because it is, but because I've run into more significant issues building QT since I moved to 6.5.1.
-