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

go1.11 build shared and for to windows dll still not supported from year 2015 on win x64 #27922

Closed
ManPython opened this issue Sep 28, 2018 · 19 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ManPython
Copy link

ManPython commented Sep 28, 2018

This is still missed function in x64 amd windows system from 2015 y. Why?
#11058
#23052

http:https://blog.ralch.com/tutorial/golang-sharing-libraries/

@ManPython ManPython changed the title go1.11 build c-shared and for to windows dll still not supported from year 2015 go1.11 build c-shared and for to windows dll still not supported from year 2015 on win x64 Sep 28, 2018
@ianlancetaylor
Copy link
Contributor

The two issues you mention are closed. What actual problem are you asking about?

@ManPython
Copy link
Author

About this: "-buildmode=c-shared not supported on windows/amd64"
Both issues touching this.

@ianlancetaylor
Copy link
Contributor

I'm sorry, I don't understand. Those issues are closed. As of the 1.10 release, -buildmode=c-shared does work on windows/amd64.

@ManPython
Copy link
Author

ManPython commented Sep 28, 2018

Imposible. I checked now on v1.10 and unistaled this to updated to v1.11 and "-buildmode=c-shared not supported on windows/amd64" on both.
My OS W7x64 U Sp1

@AlexRouSg
Copy link
Contributor

AlexRouSg commented Sep 28, 2018

What is the exact command you are trying to run and what is the exact output?
I just tested on windows 10 x64 with 1.11 and it works

@katiehockman katiehockman added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 28, 2018
@ManPython
Copy link
Author

ManPython commented Sep 28, 2018

I lost here. I rebot OS, and again unistaled go and instal v1.11
https://www.darkcoding.net/software/building-shared-libraries-in-go-part-1/

When runing in bat
E:\GO\go build -o libdoubler.so -buildmode=c-archive main.go
runtime/cgo
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

E:\GO\go build -ldflags="-s -w" -buildmode=shared main.go
runtime/cgo
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

E:\GO\go build -ldflags="-s -w" -buildmode=shared main.go
-buildmode=shared not supported on windows/amd64

E:\GO\go build -ldflags="-s -w" -buildmode=c-archive main.go
runtime/cgo
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

go install -buildmode=shared -linkshared std
-buildmode=shared not supported on windows/amd64

go install -buildmode=shared -linkshared main.go
-buildmode=shared not supported on windows/amd64

I have instaled:
TDM-GCC-32
TDM-GCC-64
mingw-w64

@AlexRouSg
Copy link
Contributor

This is not a problem with Go, this is your environment not being configured correctly.

Please uninstall all mingw versions, restart, and reinstall only TDM-GCC-64 and make sure Add to PATH is selected
image
image
image

@katiehockman katiehockman removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 28, 2018
@katiehockman
Copy link
Contributor

@ManPython did this resolve your issue?

@katiehockman katiehockman added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 28, 2018
@ManPython
Copy link
Author

ManPython commented Sep 28, 2018

Not solved.
Now I have just TDM-GCC-64 and no changes around problem.

But checked cc1.exe by https://docs.microsoft.com/en-us/sysinternals/downloads/sigcheck

tdm-gcc-64\libexec\gcc\x86_64-w64-mingw32\5.1.0\cc1.exe:
Verified: Unsigned
Link date: 10:58 2027-08-18
Publisher: n/a
Company: n/a
Description: n/a
Product: n/a
Prod version: n/a
File version: n/a
MachineType: 32-bit

Soo? There is long time conflict? Coz TDM is not updated from 2015 on website.
http:https://tdm-gcc.tdragon.net/

@AlexRouSg
Copy link
Contributor

AlexRouSg commented Sep 28, 2018

  • From the desktop, right click the Computer icon.
  • Choose Properties from the context menu.
  • Click the Advanced system settings link.
  • Click Environment Variables

image

If C:\TDM-GCC-64\bin or where you installed TDM is not in that string, add it by putting C:\WHERE IS TDM-GCC-64\bin; at the front. The ; is important

If that still doesn't work, open the command line and copy paste the output of gcc --version

@ManPython
Copy link
Author

Still not working.

C:>gcc --version
gcc (MinGW.org GCC-6.3.0-1) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

tdm-gcc-64\bin\gcc.exe:
Verified: Unsigned
Link date: 02:00 1970-01-01
Publisher: n/a
Company: n/a
Description: n/a
Product: n/a
Prod version: n/a
File version: n/a
MachineType: 32-bit

@AlexRouSg
Copy link
Contributor

You still have multiple mingw installations. If you only had TDM it would've said gcc.exe (tdm64-1) 5.1.0

@ManPython
Copy link
Author

ManPython commented Sep 28, 2018

You was right. I do research with regedit i found minigw with other software.
Now working c-shared, but.. just these function as bellow not

go build -o libdoubler.so -buildmode=shared main.go
-buildmode=shared not supported on windows/amd64

go build -o libdoubler.dll -buildmode=shared main.go
-buildmode=shared not supported on windows/amd64

@AlexRouSg, @ianlancetaylor thank You for help.

@AlexRouSg
Copy link
Contributor

Well as it says, buildmode=shared isn't implemented yet for windows

@ManPython ManPython changed the title go1.11 build c-shared and for to windows dll still not supported from year 2015 on win x64 go1.11 build shared and for to windows dll still not supported from year 2015 on win x64 Sep 28, 2018
@ManPython
Copy link
Author

So we can't produce .dll in win x64? Just .so?
Is this working on win 386 and go1.11.windows-386 this same (just .so?) ?

I changed topic to clarify situation.

@AlexRouSg
Copy link
Contributor

buildmode=c-shared creates a dll to be used in C programs. It is creating a .so cause you told it to name it .so, change the name to be .dll
buildmode=shared is to create a dll to be used in Go programs, it is not implemented for windows at all.

@AlexRouSg
Copy link
Contributor

Please direct further questions to one of the places listed in https://github.com/golang/go/wiki/Questions
The bug tracker is only used for bugs, and this is clearly not a bug or actionable report.

@ManPython
Copy link
Author

ManPython commented Sep 28, 2018

Ok. Just last one.
I created .dll but can't call this by ctypes in python this same as .so

In dependency walker I don't see the function DoubleIt as normaly in other .dll's
The .so is available to see functions
so in dependecy

BTW strange that is soo many _cgo functions

@ianlancetaylor
Copy link
Contributor

I'm closing this issue. Please use a forum, where there will be more people who can help you. See https://golang.org/wiki/Questions . Thanks.

@golang golang locked and limited conversation to collaborators Sep 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants