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 `__intrinsic_setjmpex' #125

Open
mvasi90 opened this issue Feb 4, 2024 · 6 comments
Open

undefined reference to `__intrinsic_setjmpex' #125

mvasi90 opened this issue Feb 4, 2024 · 6 comments

Comments

@mvasi90
Copy link

mvasi90 commented Feb 4, 2024

Impossible to build from Linux to Windows binary:

/usr/lib/go/pkg/tool/linux_amd64/link: running x86_64-w64-mingw32-g++ failed: exit status 1
/usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /home/developer/go/src/github.com/pwiecz/go-fltk/lib/windows/amd64/libfltk_images.a(Fl_JPEG_Image.cxx.obj):Fl_JPEG_Image.:(.text+0x1b8): undefined reference to `__intrinsic_setjmpex'
/usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /home/developer/go/src/github.com/pwiecz/go-fltk/lib/windows/amd64/libfltk_images.a(Fl_PNG_Image.cxx.obj):Fl_PNG_Image.c:(.text+0x133): undefined reference to `__intrinsic_setjmpex'
/usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /home/developer/go/src/github.com/pwiecz/go-fltk/lib/windows/amd64/libfltk_png.a(png.c.obj):png.c:(.text+0x1367): undefined reference to `__intrinsic_setjmpex'
/usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /home/developer/go/src/github.com/pwiecz/go-fltk/lib/windows/amd64/libfltk_png.a(pngerror.c.obj):pngerror.c:(.text+0xbd5): undefined reference to `__intrinsic_setjmpex'
/usr/lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld: /home/developer/go/src/github.com/pwiecz/go-fltk/lib/windows/amd64/libfltk_png.a(pngerror.c.obj):pngerror.c:(.text+0x13ea): undefined reference to `__intrinsic_setjmpex'
collect2: error: ld returned 1 exit status
@MoAlyousef
Copy link
Contributor

MoAlyousef commented Feb 6, 2024

I think it's because the CI mingw windows toolchain uses ucrt, whereas the mingw toolchain on linux uses msvcrt.

Related to #115

@zivlamp
Copy link

zivlamp commented Mar 22, 2024

I had the same problem when I upgraded the dependencies in go.mod to v0.0.0-20240129144424-3260f5ba37f1.
I use mingw toolchain in windows.

@pwiecz
Copy link
Owner

pwiecz commented Mar 22, 2024

@zivlamp I'll be looking into it, but most likely next week.

@zivlamp
Copy link

zivlamp commented Mar 23, 2024

Thanks for reply.
Additional note: It's no problem in Linux, and it compiles fine in windows with version 20221204.

pwiecz added a commit that referenced this issue Mar 29, 2024
Should fix the "undefined reference to `__intrinsic_setjmpex'" error.
For #125
@pwiecz
Copy link
Owner

pwiecz commented Apr 3, 2024

I've rebuilt the windows libraries using another toolchain. You can see if it helps.
When not crosscompiling it's always recommended, especially under Windows, to rebuild the fltk binaries from source by invoking go generate from go-fltk sources (from Windows command prompt).

@zivlamp
Copy link

zivlamp commented Apr 4, 2024

I switched the version to the latest in go.mod.
It's working now! Thanks for your work and suggestions!

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

4 participants