storj / uplink-c

Uplink C library
MIT License
25 stars 8 forks source link

Error when make build #15

Open Nafidinara opened 2 years ago

Nafidinara commented 2 years ago

Hello, I'm always getting error when try to run make build. this is the detail : go build -ldflags="-s -w" -buildmode c-shared -o .build/uplink.so. runtime/cgo cgo-builtin-prolog:1: stddef.h: No such file or directory make: *** [build] Error 2 Can you help me how to solve this?

Nafidinara commented 2 years ago

image

ifraixedes commented 2 years ago

Hello @Nafidinara,

Can you provide details of your environment (OS version, etc.), please?

mniewrzal commented 2 years ago

Also, could you give us an output of make -v command?

Nafidinara commented 2 years ago

OS : Windows 10 Go version : go1.18.2 windows/amd64

and this when I run make -v GNU Make 3.82 Built for i686-pc-mingw32 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Erikvv commented 2 years ago

I wonder if you may need to install the Windows SDK (https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)

Erikvv commented 2 years ago

For github.com/TopperDEL/uplink.net our friend installs MSYS2 and within that installs the package group mingw-w64-x86_64-toolchain. This also supplies stddef.h.

egonelbre commented 2 years ago

I've found that https://jmeubank.github.io/tdm-gcc/ is usually the easiest way to get C compiling to work with Go + Windows. This assumes it doesn't need to link to external libs (e.g. portaudio) -- in other words, it should work fine with uplink-c.

ifraixedes commented 1 year ago

I'm wondering what we have to do to close this issue. Should we document something in the README about compiling it in Windows?

I'm also wondering how the current build target can generate a DLL for windows.