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

Error: Missing libgcc_s_dw2-1.dll in MINGW32 Environment #19

Open
resistance-shimako opened this issue Nov 16, 2024 · 0 comments
Open

Comments

@resistance-shimako
Copy link

An Issue That Occurred

Error libgcc_s_dw2-1.dll missing in a program that dynamically links and executes the built libserialport-0.dll

PC Environment

  • Build Environment: MSYS2 MINGW32 on Windows 10 Home 64Bit 22H2
  • MSYS2 Version: msys2-x86_64-20240727
  • Note: This issue does not occur in programs built in the MSYS2 MINGW64 environment. It only occurs in programs built in the MSYS2 MINGW32 environment.

Solution

Rewriting Makefile.am and giving the -static-libgcc option solved the problem.

Specifically, rewrite the following

@@ -27,6 +27,9 @@ AM_CFLAGS = -std=c99 -Wall -Wextra -pedantic -Wmissing-prototypes -Wshadow
 # Set flag used in libserialport.h to indicate we are building the library
 # using autotools.
 AM_CFLAGS += -DLIBSERIALPORT_ATBUILD
+if WIN32
+AM_CFLAGS += -static-libgcc
+endif
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

1 participant