StackExchange / wmi

WMI for Go
http://godoc.org/github.com/StackExchange/wmi
MIT License
433 stars 173 forks source link

safeArray.ToValueArray undefined #29

Closed rokett closed 7 years ago

rokett commented 7 years ago

Hi,

I'm getting the following error when trying to compile an application using this package.

vendor\github.com\StackExchange\wmi\wmi.go:377: safeArray.ToValueArray undefined (type *ole.SafeArrayConversion has no field or method ToValueArray)

I've used this package in the past and the same message hasn't appeared previously.

For reference I'm using Glide to import dependencies, and am using the following versions of this package and go-ole.

Has anyone come across this issue before?

thanks.

rokett commented 7 years ago

I'm not sure what the problem was but I noticed Glide was having issues pulling in dependent packages, so I switched to govendor and it all seems to be working now.

SilverCory commented 7 years ago

I'm getting this with godep

SilverCory commented 7 years ago

Caused by go-ole tag v1.2.0 not containing ToValueArray in safearrayconversion.go. This is the correct behaviour of Glide and GoDep.

https://github.com/go-ole/go-ole/blob/v1.2.0/safearrayconversion.go Screenshot

Possible solution; in your package manager's config to use master. In theory this should work, however in practice at least with godep, it fails with

$>dep ensure
ensure Solve(): No versions of github.com/go-ole/go-ole met constraints:
        v1.2.0: Could not introduce github.com/go-ole/go-ole@v1.2.0, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        v1.1.1: Could not introduce github.com/go-ole/go-ole@v1.1.1, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        v1.1.0: Could not introduce github.com/go-ole/go-ole@v1.1.0, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        v1.0.1: Could not introduce github.com/go-ole/go-ole@v1.0.1, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        v1.0.0: Could not introduce github.com/go-ole/go-ole@v1.0.0, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        v0.1.0: Could not introduce github.com/go-ole/go-ole@v0.1.0, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        master: Unable to update checked out version: error: Your local changes to the following files would be overwritten by checkout:
        guid.go
        idispatch_windows.go
        ienumvariant_test.go
        iinspectable_windows.go
        ole.go
        oleutil/connection_windows.go
        oleutil/oleutil.go
        safearray_func.go
        safearray_windows.go
        safearrayconversion.go
        variant.go
Please commit your changes or stash them before you switch branches.
Aborting

        v1.0: Could not introduce github.com/go-ole/go-ole@v1.0, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        v1.1: Could not introduce github.com/go-ole/go-ole@v1.1, as it is not allowed by constraint master from project github.com/StackExchange/wmi.
        v1.2: Could not introduce github.com/go-ole/go-ole@v1.2, as it is not allowed by constraint master from project github.com/StackExchange/wmi.

Cause for this to be reopened and maybe opened on go-ole? I won't do anything without someone else's confirmation.

xphyr commented 6 years ago

I am running into the same issues with "dep". It almost seems like go-ole needs to be tagged with a v1.3 version that has the ToValueArray method. In the mean time, I am trying to figure out how to override godep to pull the proper version of go-ole. Any chance someone can look at this again?

SilverCory commented 6 years ago

@xphyr I've found this to work.


[[override]]
  name = "github.com/go-ole/go-ole"
  branch = "master"```