I have the following code:

#include <ftbuild.h>
#include <ftconfig.h>
#include <ftlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <fcntl.h>
#if HAVE_STRINGS_H
#include <strings.h>
#endif

#if HAVE_STRING_H
#include <string.h>
#endif

int main(int argc, char *argv[]) {
struct ftio flow;
struct ftprof fp;
fterr_setid(argv[0]);
ftprof_start(&fp);
if(ftio_init(&flow, 0, FT_IO_FLAG_READ) < 0)
fterr_errx(1, "ftio_init(): failed");
ftio_header_print(&flow, stdout, '#');

return 0;
}

It compiles finewith gcc:
gcc -g -Wall -o test -L../lib main.c -lft -lnsl -lwrap -lz -I. -I../lib

But doesn't with g++:
g++ -g -Wall -o test -L../lib main.c -lft -lnsl -lwrap -lz -I. -I../lib

/tmp/ccO5Tsab.o(.text+0x28): In function `main':
/home/kornerr/cpp/netflow/flow-tools-0.68/src/main.c:25: undefined reference
to `fterr_setid(char*)'
/tmp/ccO5Tsab.o(.text+0x3a):/home/kornerr/cpp/netflow/flow-tools-0.68/src/main.c:26:
undefined reference to `ftprof_start(ftprof*)'
/tmp/ccO5Tsab.o(.text+0x50):/home/kornerr/cpp/netflow/flow-tools-0.68/src/main.c:27:
undefined reference to `ftio_init(ftio*, int, int)'
/tmp/ccO5Tsab.o(.text+0x66):/home/kornerr/cpp/netflow/flow-tools-0.68/src/main.c:28:
undefined reference to `fterr_errx(int, char const*, ...)'
/tmp/ccO5Tsab.o(.text+0x80):/home/kornerr/cpp/netflow/flow-tools-0.68/src/main.c:29:
undefined reference to `ftio_header_print(ftio*, _IO_FILE*, char)'
collect2: ld returned 1 exit status

What's wrong?
_______________________________________________
Flow-tools mailing list
[EMAIL PROTECTED]
http://mailman.splintered.net/mailman/listinfo/flow-tools

Reply via email to