[go-nuts] Re: [cgo ] Export go function to C - illegal character
Hello Finaly, Isegal helps me to solve this problem. You can have a complete description on how to proceed here: https://github.com/golang/go/issues/32851 Le dimanche 23 juin 2019 13:49:33 UTC+2, nobody nobodye a écrit : > > Hello, > > I need some assistance to export a GO dll function to a C program. > > The C program (wich i m not the author) required to call a function with > this name: _RVExtension@12 > > so, i simply declare my go function like this: > > //export _RVExtension@12 > func _RVExtension@12(output *C.char, outputsize C.size_t, input *C.char) { > Saisissez le code ici... > > but when i try to compile it, it returns an illegal character U+0040 '@' > error. > > Do you know if there is a workaround about this ? I m not familiar with C > code and i don't understand why there is @12 in the function name. > > note: for the 64 bits the entry point is simple : RVExtension and it > works perfectly well. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/4c600346-6e0b-4c2b-b813-fb2cc7b7e950%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: [cgo ] Export go function to C - illegal character
hi don't success to solve this subject. Here an example with the simple code shown in those slides: http://akrennmair.github.io/golang-cgo-slides/#10 This code doesn't works anymore, or perhaps there is some special command line to build it ? I thought it was possible to create a C function wich export the mangle name wich call the go code. When i put my c code in a c file in the directory, the c file is not compiled. Le dimanche 23 juin 2019 13:49:33 UTC+2, nobody nobodye a écrit : > > Hello, > > I need some assistance to export a GO dll function to a C program. > > The C program (wich i m not the author) required to call a function with > this name: _RVExtension@12 > > so, i simply declare my go function like this: > > //export _RVExtension@12 > func _RVExtension@12(output *C.char, outputsize C.size_t, input *C.char) { > Saisissez le code ici... > > but when i try to compile it, it returns an illegal character U+0040 '@' > error. > > Do you know if there is a workaround about this ? I m not familiar with C > code and i don't understand why there is @12 in the function name. > > note: for the 64 bits the entry point is simple : RVExtension and it > works perfectly well. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9b386629-7878-4874-a0a7-c46fdc812efc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: [cgo ] Export go function to C - illegal character
as asked by Jason, i give more information. I build a 32 bits .dll and there was no error message. When i launch the dll with the c program, the c program return a generic error message "method is not recognized" wich happens when the entry point name is wrong. So the C program expected a function named _RVExtension@12 and go returns #ifdef __cplusplus extern "C" { #endif extern void _RVExtensionVersion(char* p0, size_t p1); extern void _RVExtensionArgs(char* p0, size_t p1, char* p2, char** p3, int p4); extern void _RVExtension(char* p0, size_t p1, char* p2); #ifdef __cplusplus } #endif Le dimanche 23 juin 2019 20:15:50 UTC+2, nobody nobodye a écrit : > > the dll is build but the entry point not works correctly :( > > Le dimanche 23 juin 2019 19:10:52 UTC+2, nobody nobodye a écrit : >> >> thanks you for your answer. I will check for this :) >> >> Le dimanche 23 juin 2019 18:58:22 UTC+2, Jason E. Aten a écrit : >>> >>> The @12 part isn't legal as part of a function name, as the compiler is >>> telling you. You must remove it. >>> >>> On Sunday, June 23, 2019 at 6:49:33 AM UTC-5, nicolas...@yahoo.fr wrote: Hello, I need some assistance to export a GO dll function to a C program. The C program (wich i m not the author) required to call a function with this name: _RVExtension@12 so, i simply declare my go function like this: //export _RVExtension@12 func _RVExtension@12(output *C.char, outputsize C.size_t, input *C.char ) {Saisissez le code ici... but when i try to compile it, it returns an illegal character U+0040 '@' error. Do you know if there is a workaround about this ? I m not familiar with C code and i don't understand why there is @12 in the function name. note: for the 64 bits the entry point is simple : RVExtension and it works perfectly well. >>> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/433f5f22-bcc9-4ee9-9ac4-164a71f25e47%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: [cgo ] Export go function to C - illegal character
the dll is build but the entry point not works correctly :( Le dimanche 23 juin 2019 19:10:52 UTC+2, nobody nobodye a écrit : > > thanks you for your answer. I will check for this :) > > Le dimanche 23 juin 2019 18:58:22 UTC+2, Jason E. Aten a écrit : >> >> The @12 part isn't legal as part of a function name, as the compiler is >> telling you. You must remove it. >> >> On Sunday, June 23, 2019 at 6:49:33 AM UTC-5, nicolas...@yahoo.fr wrote: >>> >>> Hello, >>> >>> I need some assistance to export a GO dll function to a C program. >>> >>> The C program (wich i m not the author) required to call a function with >>> this name: _RVExtension@12 >>> >>> so, i simply declare my go function like this: >>> >>> //export _RVExtension@12 >>> func _RVExtension@12(output *C.char, outputsize C.size_t, input *C.char) >>> {Saisissez le code ici... >>> >>> but when i try to compile it, it returns an illegal character U+0040 '@' >>> error. >>> >>> Do you know if there is a workaround about this ? I m not familiar with >>> C code and i don't understand why there is @12 in the function name. >>> >>> note: for the 64 bits the entry point is simple : RVExtension and it >>> works perfectly well. >>> >> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0aedbdc3-0758-45e4-b0c6-288f2b5b7341%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: [cgo ] Export go function to C - illegal character
thanks you for your answer. I will check for this :) Le dimanche 23 juin 2019 18:58:22 UTC+2, Jason E. Aten a écrit : > > The @12 part isn't legal as part of a function name, as the compiler is > telling you. You must remove it. > > On Sunday, June 23, 2019 at 6:49:33 AM UTC-5, nicolas...@yahoo.fr wrote: >> >> Hello, >> >> I need some assistance to export a GO dll function to a C program. >> >> The C program (wich i m not the author) required to call a function with >> this name: _RVExtension@12 >> >> so, i simply declare my go function like this: >> >> //export _RVExtension@12 >> func _RVExtension@12(output *C.char, outputsize C.size_t, input *C.char) >> {Saisissez le code ici... >> >> but when i try to compile it, it returns an illegal character U+0040 '@' >> error. >> >> Do you know if there is a workaround about this ? I m not familiar with C >> code and i don't understand why there is @12 in the function name. >> >> note: for the 64 bits the entry point is simple : RVExtension and it >> works perfectly well. >> > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c9b80744-6c8e-4047-99b3-10b5373307a8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: [cgo ] Export go function to C - illegal character
The @12 part isn't legal as part of a function name, as the compiler is telling you. You must remove it. On Sunday, June 23, 2019 at 6:49:33 AM UTC-5, nicolas...@yahoo.fr wrote: > > Hello, > > I need some assistance to export a GO dll function to a C program. > > The C program (wich i m not the author) required to call a function with > this name: _RVExtension@12 > > so, i simply declare my go function like this: > > //export _RVExtension@12 > func _RVExtension@12(output *C.char, outputsize C.size_t, input *C.char) { > Saisissez le code ici... > > but when i try to compile it, it returns an illegal character U+0040 '@' > error. > > Do you know if there is a workaround about this ? I m not familiar with C > code and i don't understand why there is @12 in the function name. > > note: for the 64 bits the entry point is simple : RVExtension and it > works perfectly well. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/fa4f9d53-84c0-416a-94af-4cf16d787c27%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.