I'm trying to compile the vmware vmci example program. The program is divided into two parts
a) kernel module b) example datagram program
When i compiled that datagram program i get these errors :
gcc -I headers_path datagramApp.c
/tmp/cc6KkQ4a.o: In function开发者_StackOverflow中文版 `main':
datagramApp.c:(.text+0x16c): undefined reference to `VMCI_InitApp'
datagramApp.c:(.text+0x1be): undefined reference to `VMCI_CleanupApp'
/tmp/cc6KkQ4a.o: In function `DoDatagramServer':
datagramApp.c:(.text+0x1e6): undefined reference to `VMCIDatagram_CreateHnd'
datagramApp.c:(.text+0x24f): undefined reference to `VMCIDs_Lookup'
datagramApp.c:(.text+0x2d7): undefined reference to `VMCIResource_AddClientPrivileges'
datagramApp.c:(.text+0x333): undefined reference to `VMCIDs_Register'
datagramApp.c:(.text+0x3bf): undefined reference to `VMCIDatagram_RecvFrom'
datagramApp.c:(.text+0x44f): undefined reference to `VMCIDatagram_SendTo'
datagramApp.c:(.text+0x4a8): undefined reference to `VMCIDs_Unregister'
datagramApp.c:(.text+0x4c0): undefined reference to `VMCIDatagram_DestroyHnd'
/tmp/cc6KkQ4a.o: In function `DoDatagramClient':
datagramApp.c:(.text+0x505): undefined reference to `VMCIDs_Lookup'
datagramApp.c:(.text+0x563): undefined reference to `VMCIDatagram_CreateHnd'
datagramApp.c:(.text+0x608): undefined reference to `VMCIResource_AddClientPrivileges'
datagramApp.c:(.text+0x680): undefined reference to `VMCIDatagram_SendTo'
datagramApp.c:(.text+0x6b8): undefined reference to `VMCIDatagram_RecvFrom'
datagramApp.c:(.text+0x6f7): undefined reference to `VMCIDatagram_DestroyHnd'
TNX
You need to link with a (shared) object to get the userland interface of VMCI
AFAICT this is a propriatary API from Vmware(?) that you should install [1]
The typical compile line would then look more like:
gcc -I <headers_path> datagramApp.c -lvmci
Notes
- replace header_path with something like (depending on where the module was built)
- /usr/src/linux/include
- /opt/vmware/include
-lvmci
would suggest the availability of a libvmci.so in your library path (remember tosudo ldconfig -a
, optionally include-L/path/to/libs
in order to make gcc/ld find)them
[1] perhaps as part of the Custom Installation of VMware Tools?
精彩评论