gen2brain / iup-go

Cross-platform UI library with native controls
MIT License
282 stars 11 forks source link

Multiple includes of iup_datepick.c #21

Open Heribert17 opened 1 year ago

Heribert17 commented 1 year ago

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/iup@v0.0.0-20231016042002-a3b3bba3edbc/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.

gen2brain commented 1 year ago

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.

Heribert17 commented 1 year ago

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

coreybutler commented 6 months ago

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

icedream commented 5 months ago

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.

fcying commented 1 month ago

get same issue when build alarm example, except on Windows 10 with go 1.23 version v0.0.0-20230906093706-8b037fe6a7bd work fine