-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Project causes compilation issues when included in other projects on Windows: __imp___iob_func #1120
Comments
@steowens As mentioned in golang/go#57455 this issue is caused by cgo itself. If you are unable to avoid transitively importing this library (or any other that relies on cgo), I would suggest forcibly setting |
Thanks I was able to resolve the issue to switching to github.com/glebarez/go-sqlite go native sqlite and thereby eliminating the cgo dependency. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See comments here:
golang/go#57455 (comment)
Short issue is that adding this dependency to a project that is compiled with more recent versions of Windows breaks the project possibly due to some binary dependencies or c code included in the go-sqlite3 project. The problem manifests when you take a project that compiles just fine and add this project to it as a dependency then you go to build and you get :
C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 c:/program files/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\steve\AppData\Local\Temp\go-link-2769819953\000016.o: in function
_cgo_preinit_init': \\_\_\runtime\cgo/gcc_libinit_windows.c:40: undefined reference to
__imp___iob_func' c:/program files/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\steve\AppData\Local\Temp\go-link-2769819953\000016.o: in functionx_cgo_notify_runtime_init_done': \\_\_\runtime\cgo/gcc_libinit_windows.c:105: undefined reference to
__imp___iob_func' c:/program files/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\steve\AppData\Local\Temp\go-link-2769819953\000016.o: in function_cgo_beginthread': \\_\_\runtime\cgo/gcc_libinit_windows.c:149: undefined reference to
__imp___iob_func' c:/program files/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-14.0.6-mingw-w64ucrt-10.0.0-r2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\steve\AppData\Local\Temp\go-link-2769819953\000017.o: in function `x_cgo_thread_start': \__\runtime\cgo/gcc_util.c:18: undefined reference to ' collect2.exe: error: ld returned 1 exit status exit status 2The text was updated successfully, but these errors were encountered: