Skip to content
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

app don't compile for windows arch #48

Open
SMods11 opened this issue Mar 13, 2022 · 14 comments
Open

app don't compile for windows arch #48

SMods11 opened this issue Mar 13, 2022 · 14 comments

Comments

@SMods11
Copy link

SMods11 commented Mar 13, 2022

When i try to compile with command GOOS=windows GOARCH=amd64 go build -o bin/test.exe test.go

I have this error :

# github.com/TokTok/go-toxcore-c
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:11:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:15:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:19:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:23:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:46:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:69:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:79:7: undefined: CONNECTION_NONE
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:81:7: undefined: CONNECTION_TCP
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:83:7: undefined: CONNECTION_UDP

When i compile on linux / run it it work perfectly can you help me ?

@iphydf
Copy link
Member

iphydf commented Mar 13, 2022

Can you try master? 0.2.0 is rather old.

@iphydf
Copy link
Member

iphydf commented Mar 13, 2022

Or v0.2.17 which I just released.

@SMods11
Copy link
Author

SMods11 commented Mar 13, 2022

Or v0.2.17 which I just released.

i have this error when i try to install it :

# github.com/TokTok/go-toxcore-c
../../../go/pkg/mod/github.com/!tok!tok/[email protected]/toxav.go:319:48: could not determine kind of name for C.toxav_audio_data_cb

@iphydf
Copy link
Member

iphydf commented Mar 13, 2022

Are you using the latest toxcore? Which version of toxcore are you using for this?

@SMods11
Copy link
Author

SMods11 commented Mar 13, 2022

Are you using the latest toxcore? Which version of toxcore are you using for this?

i have install it with sudo apt install libtoxcore-dev wich is in version 0.2.12-1

@iphydf
Copy link
Member

iphydf commented Mar 13, 2022

That one is too old. But: it is compatible with the newer header file, so you could as a hack just copy https://github.com/TokTok/c-toxcore/blob/master/toxcore/tox.h over your system-installed tox.h. Alternatively, build and install toxcore from source.

@SMods11
Copy link
Author

SMods11 commented Mar 13, 2022

That one is too old. But: it is compatible with the newer header file, so you could as a hack just copy https://github.com/TokTok/c-toxcore/blob/master/toxcore/tox.h over your system-installed tox.h. Alternatively, build and install toxcore from source.

When i try to compile new toxcore with source i have this error : https://pastebin.com/LxzJPrQg

And with the trick it don't seems to work 🤔 ( i changed tox.h located in /usr/include/tox/tox.h )

go get github.com/TokTok/[email protected]
# github.com/TokTok/go-toxcore-c
../../../go/pkg/mod/github.com/!tok!tok/[email protected]/toxav.go:319:48: could not determine kind of name for C.toxav_audio_data_cb

@iphydf
Copy link
Member

iphydf commented Mar 13, 2022

@SMods11
Copy link
Author

SMods11 commented Mar 13, 2022

Sorry, https://github.com/TokTok/c-toxcore/blob/master/toxav/toxav.h you need this one.

Ok ur trick worked for install v0.2.17 :

go get: added github.com/TokTok/go-toxcore-c v0.2.17

But still error when i try to compile on windows 🤔

GOOS=windows GOARCH=amd64 go build test.go

# github.com/TokTok/go-toxcore-c
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:11:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:15:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:19:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/hooks.go:23:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:49:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:85:13: undefined: Tox
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:95:7: undefined: CONNECTION_NONE
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:97:7: undefined: CONNECTION_TCP
../../../../go/pkg/mod/github.com/!tok!tok/[email protected]/utils.go:99:7: undefined: CONNECTION_UDP

@iphydf
Copy link
Member

iphydf commented Mar 13, 2022

It's a strange error. The last 3 errors indicate that const.go is (partially?) missing. The first few indicate that tox.go (which defines struct Tox) is missing. I don't know how to fix that, as I don't have Windows to reproduce it with.

@iphydf
Copy link
Member

iphydf commented Mar 13, 2022

It might be an issue with line endings. Maybe a // turns the rest of the file into a comment. Can you check tox.go and const.go to see if the line endings make sense? Maybe you need to do some unix2dos or something.

@SMods11
Copy link
Author

SMods11 commented Mar 14, 2022

It's a strange error. The last 3 errors indicate that const.go is (partially?) missing. The first few indicate that tox.go (which defines struct Tox) is missing. I don't know how to fix that, as I don't have Windows to reproduce it with.

I have also linux but i want to compile it for windows

@SMods11
Copy link
Author

SMods11 commented Mar 14, 2022

It might be an issue with line endings. Maybe a // turns the rest of the file into a comment. Can you check tox.go and const.go to see if the line endings make sense? Maybe you need to do some unix2dos or something.

I will check this evening

@Elara6331
Copy link

Are you trying to cross-compile from Linux to Windows? If so, it's not going to work because this uses CGo. You'll need a version of c-toxcore and all its dependencies that's already compiled for Windows and a Windows C cross-compiler to do that. The easiest way to do this is to compile it on a Windows computer.

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

3 participants