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

undefined reference to `DWriteCreateFactory' #518

Open
fxqy opened this issue Dec 19, 2020 · 7 comments
Open

undefined reference to `DWriteCreateFactory' #518

fxqy opened this issue Dec 19, 2020 · 7 comments

Comments

@fxqy
Copy link

fxqy commented Dec 19, 2020

What else do I need to add to the link options?
image

@fxqy
Copy link
Author

fxqy commented Dec 19, 2020

-lui -lgdi32 -lcomctl32 -ld2d1 -lole32 -ldwrite -lstdc++ -lgcc_s -lgcc_eh -lwinpthread
I added these libraries and compiled them, but I couldn't run them

C:\Windows\system32\cmd.exe /C C:/msys64/mingw64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ luia - Debug ]----------"
mingw32-make[1]: Entering directory 'D:/Dev/c/codelitespace/luia'
C:/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe -o Debug/luia @"luia.txt" -L. -LD:\dev\c\libui\build\meson-out   -lui -lgdi32 -lcomctl32 -ld2d1 -lole32 -ldwrite -lstdc++ -lgcc_s -lgcc_eh -lwinpthread
mingw32-make[1]: Leaving directory 'D:/Dev/c/codelitespace/luia'
====0 errors, 0 warnings====

image

@fxqy
Copy link
Author

fxqy commented Dec 19, 2020

It is not okay to add all the ‘*.dll’ files to run
image

@msink
Copy link
Contributor

msink commented Dec 19, 2020

Did you try to copy your .exe to C:/msys64/mingw64/bin and execute from there?
If it runs - probably you missed one or more .dll

@msink
Copy link
Contributor

msink commented Dec 19, 2020

Or add "-Wl,-Bstatic -lstdc++ -static" before libs list to link them statically.

@fxqy
Copy link
Author

fxqy commented Dec 20, 2020

Did you try to copy your .exe to C:/msys64/mingw64/bin and execute from there?
If it runs - probably you missed one or more .dll
It's still wrong!
image

@fxqy
Copy link
Author

fxqy commented Dec 20, 2020

Or add "-Wl,-Bstatic -lstdc++ -static" before libs list to link them statically.

C:\Windows\system32\cmd.exe /C C:/msys64/mingw64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ luia - Debug ]----------"
mingw32-make[1]: Entering directory 'D:/Dev/c/codelitespace/luia'
C:/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe -o Debug/luia @"luia.txt" -L. -LD:\dev\c\libui\build\meson-out   -Wl,-Bstatic -lstdc++ -static -lui -lgdi32 -lcomctl32 -ld2d1 -lole32 -ldwrite -lgcc_s -lgcc_eh -lwinpthread
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0\libgcc_eh.a(unwind-seh.o):(.text+0x3d0): multiple definition of `_Unwind_Resume'; C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0\libgcc_s.a(d000015.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [luia.mk:81: Debug/luia] Error 1
mingw32-make: *** [Makefile:5: All] Error 2
mingw32-make[1]: Leaving directory 'D:/Dev/c/codelitespace/luia'
====0 errors, 0 warnings====

The compilation report is wrong
image

@andlabs
Copy link
Owner

andlabs commented Dec 20, 2020

I think -lgcc_s and -lgcc_eh are mutually exclusive, however if you are trying to statically link libgcc, then the option you want is really -static-libgcc.

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