andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 651 forks source link

collect2.exe: error: ld returned 1 exit status #319

Closed leeyuanzhang closed 2 years ago

leeyuanzhang commented 5 years ago

github.com/andlabs/ui

Go get github.com/andlabs/ui After trying to run, I get the following error

D:/Users/sammy Lee/Miniconda2/Library/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find D:/Users/sammy: No such file or directory
D:/Users/sammy Lee/Miniconda2/Library/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find Lee/Miniconda2/Library/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
PaluMacil commented 5 years ago

Make sure you mention your environment when opening an issue. I see you're using Windows, and I can tell the version of mingw but not the version of Go and the way your gcc is configured.

On Go 1.11, current version of ui I built fine with gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) but couldn't build with the same version of gcc using sjsj exceptions on 64 bit. It looks like you're using 32 bit, so I tried with gcc version 8.1.0 (i686-posix-dwarf-rev0, Built by MinGW-W64 project) but then I realized I'd need to switch to 32 bit Go to test that (I think... I'm not terribly familiar with that). I also don't have gcc 5.3 installed.

sheppe commented 5 years ago

I'm getting this error on Windows 10 64-bit. Here's the gcc -v output:

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=C:/TDM-GCC-64/bin/../libexec/gcc/x86_64-w64-mingw32/5.1.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-5.1.0/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdragon.net/bugs Thread model: posix gcc version 5.1.0 (tdm64-1)

andlabs commented 5 years ago

It appears MinGW does not like having spaces in its directory name.

sheppe commented 5 years ago
      It appears MinGW does not like having spaces in its directory name.

You're correct, which is why there are no spaces in its install path.

andlabs commented 5 years ago

@sheppe that is the problem in the original post. Your error is likely different; can you post it?

sheppe commented 5 years ago

c:/mypath/go/src/github.com/andlabs/ui/libui_windows_amd64.a(stddialogs.cpp.obj): In function msgbox': C:/projects/libui/windows/stddialogs.cpp:113: undefined reference to__imp_TaskDialog' collect2.exe: error: ld returned 1 exit status

andlabs commented 5 years ago

@sheppe that's #279

andlabs commented 5 years ago

@SammyLee666 have you tried updating MinGW-w64? If so, and it still doesn't work, I suggest reporting that it doesn't like having its own files in a directory with spaces to them.