Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

This directory contains the following files:

hello.c # The C file that will import and run the # Hello function hello.so -> ../_Go/hello.so # The shared object generated by go build hello.h -> ../_Go/hello.h # The C header file generated by go build

The symbolic links are the files that were generated by executing go build -buildmode=c-shared -o hello.so . in the _Go directory.

In order to execute the Hello function from the shared object simply compile and run the hello.c file.

$ gcc hello.c hello.so
$ LD_LIBRARY_PATH=$(pwd) ./a.out 
Hello! The square root of 4 is: 2