Skip to content

go get github.com/andlabs/ui - undefined references #229

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

Closed
redgrittybrick opened this issue Mar 1, 2017 · 7 comments

Comments

@redgrittybrick
Copy link

I am unable to install andlabs/ui - see errors below

I already installed the latest Git and updated my GCC

C:\go> go get github.com/andlabs/ui
# github.com/andlabs/ui
C:/go/src/github.com/andlabs/ui/libui_windows_amd64.a(alloc.cpp.obj): In function `uninitAlloc()':
E:/github.com/andlabs/libui/windows/alloc.cpp:16: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'
E:/github.com/andlabs/libui/windows/alloc.cpp:17: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
...
C:/msys64/mingw64/include/c++/5.3.0/ext/new_allocator.h:120: undefined reference to `_Unwind_Resume'
C:/go/src/github.com/andlabs/ui/libui_windows_amd64.a(window.cpp.obj):window.cpp:(.xdata$_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKP8uiWindowbEEE9constructIS6_JRKSt21piecewise_construct_tSt5tupleIJRS5_EESD_IJEEEEEvPT_DpOT0_+0x10): undefined reference to `__gxx_personality_seh0'
collect2.exe: error: ld returned 1 exit status

C:\go> ver
Microsoft Windows [Version 10.0.14393]

C:\go> go version
go version go1.8 windows/amd64

C:\go> gcc --version
gcc (x86_64-posix-sjlj, built by strawberryperl.com project) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\go> where gcc
D:\Apps\strawberry\c\bin\gcc.exe

C:\go> git --version
git version 2.12.0.windows.1

C:\go> echo go path is %GOPATH%
go path is C:\go
@hialpha
Copy link

hialpha commented May 25, 2017

Same issue using a different configuration:
...
U:/Work/development/Go/src/github.com/andlabs/ui/libui_windows_amd64.a(stddialogs.cpp.obj): In funct
ion `msgbox':
E:/github.com/andlabs/libui/windows/stddialogs.cpp:113: undefined reference to `__imp_TaskDialog'
U:/Work/development/Go/src/github.com/andlabs/ui/libui_windows_amd64.a(tab.cpp.obj): In function `ui
NewTab':
E:/github.com/andlabs/libui/windows/tab.cpp:278: undefined reference to `operator new(unsigned long
long)'
U:/Work/development/Go/src/github.com/andlabs/ui/libui_windows_amd64.a(tab.cpp.obj): In function `__
gnu_cxx::new_allocator<tabPage*>::allocate(unsigned long long, void const*)':
C:/msys64/mingw64/include/c++/5.3.0/ext/new_allocator.h:104: undefined reference to `operator new(un
signed long long)'
U:/Work/development/Go/src/github.com/andlabs/ui/libui_windows_amd64.a(utf16.cpp.obj): In function `
utf16dup(wchar_t const*)':
E:/github.com/andlabs/libui/windows/utf16.cpp:59: undefined reference to `__imp_wcscpy_s'
U:/Work/development/Go/src/github.com/andlabs/ui/libui_windows_amd64.a(utf16.cpp.obj): In function `
vstrf(wchar_t const*, char*)':
E:/github.com/andlabs/libui/windows/utf16.cpp:84: undefined reference to `__imp__vscwprintf'
E:/github.com/andlabs/libui/windows/utf16.cpp:90: undefined reference to `vswprintf_s'
U:/Work/development/Go/src/github.com/andlabs/ui/libui_windows_amd64.a(window.cpp.obj): In function
`__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<uiWindow* const, bool> > >::allocate(unsigned
 long long, void const*)':
C:/msys64/mingw64/include/c++/5.3.0/ext/new_allocator.h:104: undefined reference to `operator new(un
signed long long)'
U:/Work/development/Go/src/github.com/andlabs/ui/libui_windows_amd64.a(winutil.cpp.obj): In function
 `windowClassOf(HWND__*, ...)':
E:/github.com/andlabs/libui/windows/winutil.cpp:29: undefined reference to `__imp__wcsicmp'
collect2: error: ld returned 1 exit status

U:\Work\development\Go\src\github.com\hialpha\gosmart>
U:\Work\development\Go\src\github.com\hialpha\gosmart>where gcc
C:\cygwin64\bin\gcc.exe
U:\Work\development\Go\src\github.com\hialpha\gosmart>git --version
git version 2.11.0.windows.1
U:\Work\development\Go\src\github.com\hialpha\gosmart>gcc --version
gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
U:\Work\development\Go\src\github.com\hialpha\gosmart>ver
Microsoft Windows [Version 6.1.7601]
U:\Work\development\Go\src\github.com\hialpha\gosmart>

@andlabs
Copy link
Owner

andlabs commented May 25, 2017

Strongly considering making this a separate issue:

Can someone please explain why every MinGW/MinGW-w64 ABI and runtime is incompatible at link-time with each other? I'm getting tired of this issue affecting everyone. Do I need to rebuild libui to not use any MinGW runtime libraries somehow, not even static ones? Thanks.

@cfbao
Copy link

cfbao commented Jun 23, 2017

I had the same issue. Was using x86_64-7.1.0-posix-sjlj-rt_v5-rev0
Resolved by using x86_64-7.1.0-posix-seh-rt_v5-rev0 instead

Saw someone on the Internet saying it has to do with the exception handling method used. Seems to be true in my case. Maybe ReadMe should be more specific on what kind of mingw/mingw-w64 is required.

@andlabs
Copy link
Owner

andlabs commented Jun 23, 2017

I'll keep this in mind for the next stable release, as I have to reinstall MinGW-w64 anyway. Thanks for figuring it out; it should have been obvious to me given the symbol names but I long forgot what MinGW-w64 I had =P Whatever the case, you get a heart for that.

@cyclamenkde
Copy link

cyclamenkde commented Jan 30, 2018

me too


D:\SourceCode\GoProj\src\goWin>go build main.go
# command-line-arguments
.\main.go:8: undefined: ui.Main
.\main.go:9: undefined: ui.NewEntry
.\main.go:10: undefined: ui.NewButton
.\main.go:11: undefined: ui.NewLabel
.\main.go:12: undefined: ui.NewVerticalBox
.\main.go:13: undefined: ui.NewLabel
.\main.go:17: undefined: ui.NewWindow
.\main.go:20: undefined: ui.Button
.\main.go:23: undefined: ui.Window
.\main.go:24: undefined: ui.Quit
.\main.go:24: too many errors

@andlabs
Copy link
Owner

andlabs commented Jan 30, 2018

That is a different issue. See if cgo is enabled.

@andlabs
Copy link
Owner

andlabs commented Mar 26, 2018

Merged with #281.

@andlabs andlabs closed this as completed Mar 26, 2018
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

5 participants