Even when targeting C11, GCC and Clang use C99 inline semantics in which the inline directs the compiler to expect an external definition in a separate translation unit. Due to the behavior of the C99 inline semantics, the following errors occur when statically linking:
/usr/bin/ld: libvmm.a(vmmlog.c.o): in function `VmmLog_Close':
/Source/MemProcFS/vmm/vmmlog.c:70: undefined reference to `VmmLog_GetModuleInfo'
/usr/bin/ld: libvmm.a(vmmlog.c.o): in function `VmmLog_LevelGet':
/Source/MemProcFS/vmm/vmmlog.c:92: undefined reference to `VmmLog_GetModuleInfo'
/usr/bin/ld: libvmm.a(vmmlog.c.o): in function `VmmLog_LevelSet':
/Source/MemProcFS/vmm/vmmlog.c:114: undefined reference to `VmmLog_GetModuleInfo'
Please consider using static inline semantics, or force inlining. Below is a small patch that force inlines the violating functions by adding a __forceinline macro to vmm/oscompatibility.h when targeting linux:
Even when targeting C11, GCC and Clang use C99 inline semantics in which the
inline
directs the compiler to expect an external definition in a separate translation unit. Due to the behavior of the C99 inline semantics, the following errors occur when statically linking:Please consider using
static inline
semantics, or force inlining. Below is a small patch that force inlines the violating functions by adding a__forceinline
macro tovmm/oscompatibility.h
when targeting linux: