iup-go icon indicating copy to clipboard operation
iup-go copied to clipboard

Multiple includes of iup_datepick.c

Open Heribert17 opened this issue 2 years ago • 5 comments

Hello, i'm trying to compile the menu example from the example directory but i get this error message:

go run -a .
C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:/Users/herib/AppData/Local/Programs/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\herib\AppData\Local\Temp\go-link-2596143189\000124.o: in function `iupDatePickNewClass':
/tmp/go-build/windows_iupwin_datepick.cgo2.c:248: multiple definition of `iupDatePickNewClass'; C:\Users\herib\AppData\Local\Temp\go-link-2596143189\000037.o:/tmp/go-build/core_iup_datepick.cgo2.c:451: first defined here
C:/Users/herib/AppData/Local/Programs/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\herib\AppData\Local\Temp\go-link-2596143189\000124.o: in function `IupDatePick':
/tmp/go-build/windows_iupwin_datepick.cgo2.c:302: multiple definition of `IupDatePick'; C:\Users\herib\AppData\Local\Temp\go-link-2596143189\000037.o:C:/Users/herib/go/pkg/mod/github.com/gen2brain/iup-go/[email protected]/external/src/iup_datepick.c:484: first defined here
collect2.exe: error: ld returned 1 exit status

Im working on Windows 10 with go version: 'go1.21.3 windows/amd64' and gcc version: 'gcc.exe (MinGW-W64 x86_64-ucrt-mcf-seh, built by Brecht Sanders) 13.2.0'

It seems as if both files .\win\iupwin_datepick.c and .\iup_datepick.c are included in the compilation.

Heribert17 avatar Oct 24 '23 16:10 Heribert17

Can you please try some earlier version, before https://github.com/gen2brain/iup-go/commit/a3b3bba3edbcfff91127b77ae3c4b592e92577df, to confirm if the update broke this? I should probably add examples to build actions.

gen2brain avatar Oct 24 '23 17:10 gen2brain

v0.0.0-20230906093706-8b037fe6a7bd works. I get the example compiled.

Heribert17 avatar Oct 24 '23 18:10 Heribert17

I've run into the same issue, except on Windows 11 with go 1.22.1.

coreybutler avatar Apr 21 '24 18:04 coreybutler

I can confirm that this is an issue existing on the latest commit via cross-compile from Linux to Windows as well.

With v0.0.0-20230906093706-8b037fe6a7bd it compiles just fine.

icedream avatar May 05 '24 08:05 icedream