At compile time, the
#include "cgnslib.h" lets the compiler know what the calling interface for each function in the CGNS library, so the compiler can compile your calls to that library correctly.
But at link time, the linker needs to have access to the actual compiled library; otherwise, your program doesn't include the actual CGNS code.
I've never used CGNS, but if you've installed it correctly, you'll know where the library is stored and what it is named. You should change your gcc command to include the name (and possibly the directory path) of the compiled library. Your gcc command might look something like this:
Code:
gcc sample.c libgcc.a -o sample