c++linuxsocketsembeddedvxworks

undefined reference to `hostGetByName' VxWorks


I am trying to compile a simple vxworks RTP app. I am getting undefined reference to `hostGetByName'. This function should be available in user space according to the documentation, and ive included the necessary layer "IPNET_USRSPACE" in the VSB but still getting the error. Any ideas what im missing?

    /* includes */

#include <stdio.h>
#include <hostLib.h>
#include <sockLib.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <fcntl.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>

int main (
    int    argc,    /* number of arguments */
    char * argv[]   /* array of arguments */
    ) {
    
    
    
    char *inGroup;
    int host;
    
    host = hostGetByName(inGroup);

    return 0;
}

undefined reference to `hostGetByName'


Solution

  • Looks like linker is not picking net lib.

    -lnet will do the work.