alexbrainman / odbc

odbc driver written in go
BSD 3-Clause "New" or "Revised" License
345 stars 139 forks source link

Does this package support `-buildmode=c-shared` #191

Open MicahKimel opened 8 months ago

MicahKimel commented 8 months ago

I am attempting to build a dll that uses this package. On opening the odbc connection with the sql.Open("odbc", "mydns") I always receive an unable to marshal error (very generic and disappointing). My golang executable works fine outside of -buildmode=c-shared. I'm wondering if anyone has had success building a golang dll using this package. Here is a tutorial I followed for creating my dll and using it in C# https://medium.com/@shantanukhande/red-team-how-to-embed-golang-tools-in-c-e269bf33876a

Here is an example build command go build -buildmode=c-shared -o my_go.dll main.go

If anyone knows of anything I can do to debug this further please let me know.

alexbrainman commented 8 months ago

Hello @MicahKimel

If anyone knows of anything I can do to debug this further please let me know.

Not many developers see your question here. I suspect I am the only person who saw your message. I suggest you try some of those

https://github.com/golang/go/wiki/Questions

I would also ask the dude who wrote the article you are referring to

https://medium.com/@shantanukhande/red-team-how-to-embed-golang-tools-in-c-e269bf33876a

he seems to be the expert in this area.

I am also happy to try and reproduce your problem, when I have time. But you need to provide exact steps of what I need to do - including all software I need to install. Also note that I only have Linux computer.

Alex