Looks like you are on windows. I have worked a lot with windows, C/C++ and 
go, but never actually built a go dll. But, since no one else has picked 
this up, maybe I can help. 

1. I'm not sure what "the cgo" library means here? Do you have this: 
cpp<->go(dll)<->c(cgo)? Or something else. 

2. How is the memory in question allocated? What is the line of code that 
allocates it, and where does it reside in the chain above?



On Thursday, May 24, 2018 at 8:35:07 AM UTC-4, Liron Levy wrote:
>
> Hey guys,
>
> I'm in a bit of a mass, I can not see how I'm getting out of...
> What do I got:
> * A library I built using cgo.
> * A cpp app using this library (dll).
>
> What do I do:
> I try to free memory I have allocated in the cgo library in the cpp app.
>
> What Tools do I use:
> To build the library (dll) I use cgo, then creating a stub lib using the 
> VS cmd. 
> I use visual studio 2017 to compile the app (with /MD) option.
>
> What do I get:
> Critical error detected c0000374
>
> As far as I can see, this is a result of me freeing data which was 
> allocated in the dll libarary.
> I will note that this does not happen if I create a test app and compile 
> it with gcc.
>
> Unfortunately, I can not avoid using VS as I am working with some CUDA 
> stuff which like VS better :/
>
> Thanks for taking the time to read\help,
> Liron
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to