bferrell / wireplay

Automatically exported from code.google.com/p/wireplay
0 stars 0 forks source link

Link errors for 64 bit compile on OpenSuse 11.4 #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run make on OpenSuse 11.4 (x86-64)
2.
3.

What is the expected output? What do you see instead?

 Link errors during root make after compiling successfully libnids.

gvelocity@lon3eur20:~/wireplay-read-only> make
gcc -o wireplay src/wireplay.o src/log.o src/msg.o src/whook.o src/whook_rb.o 
-ggdb -L/home/gvelocity/wireplay-read-only/libnids-1.23/src/ -lnids -lpcap 
-lnet -L/usr/lib64 -lruby
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `cap_queue_process_thread':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:566: undefined 
reference to `g_async_queue_pop'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `nids_pcap_handler':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:341: undefined 
reference to `g_async_queue_lock'
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:343: undefined 
reference to `g_async_queue_length_unlocked'
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:349: undefined 
reference to `g_async_queue_push_unlocked'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `nids_exit':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:707: undefined 
reference to `g_async_queue_length'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `nids_run':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:688: undefined 
reference to `g_thread_create_full'
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:691: undefined 
reference to `g_async_queue_push'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `nids_init':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:671: undefined 
reference to `g_thread_init'
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:672: undefined 
reference to `g_async_queue_new'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `nids_next':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:747: undefined 
reference to `g_async_queue_push'
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:745: undefined 
reference to `g_thread_create_full'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `nids_dispatch':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:765: undefined 
reference to `g_async_queue_push'
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:759: undefined 
reference to `g_thread_create_full'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `cap_queue_process_thread':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:572: undefined 
reference to `g_thread_exit'
/home/gvelocity/wireplay-read-only/libnids-1.23/src//libnids.a(libnids.o): In 
function `nids_pcap_handler':
/home/gvelocity/wireplay-read-only/libnids-1.23/src/libnids.c:351: undefined 
reference to `g_async_queue_unlock'
collect2: ld returned 1 exit status
make: *** [wireplay] Error 1
gvelocity@lon3eur20:~/wireplay-read-only>
gvelocity@lon3eur20:~/wireplay-read-only>
gvelocity@lon3eur20:~/wireplay-read-only> cat Makefile
ROOT            := $(PWD)
CC                      := gcc
RUBYINC := /usr/lib64/ruby/1.8/x86_64-linux/
CFLAGS  := -DDEBUG -I $(ROOT)/include -I $(RUBYINC) -I 
$(ROOT)/libnids-1.23/src/ -ggdb
LDFLAGS := -ggdb -L$(ROOT)/libnids-1.23/src/ -lnids -lpcap -lnet -L/usr/lib64 
-lruby
PACKAGE := wireplay-$(shell date "+%Y%m%d").tar.gz
DEVPACKAGE      := wireplay-dev-$(shell date "+%Y%m%d").tar.gz
SVNPATH := https://wireplay.googlecode.com/svn/trunk

CORE_OBJ        := src/wireplay.o src/log.o src/msg.o src/whook.o src/whook_rb.o

all: wireplay

wireplay: $(CORE_OBJ)
        $(CC) -o wireplay $(CORE_OBJ) $(LDFLAGS)

.PHONY: clean
clean:
        -rm -rf wireplay
        -rm -rf src/*.o
        -rm -rf core core.*
        -rm -rf a.out

.PHONY: upload
upload:
        -make clean

.PHONY: package
package:
        make clean
        rm -rf /tmp/wireplay
        svn --force export $(SVNPATH) /tmp/wireplay
        cd /tmp/ && tar czvf $(PACKAGE) wireplay
        rm -rf /tmp/wireplay
        mv /tmp/$(PACKAGE) ./releases/

.PHONY: package-dev
package-dev:
        make clean
        rm -rf /tmp/wireplay
        svn checkout $(SVNPATH) /tmp/wireplay
        cd /tmp/ && tar czvf $(DEVPACKAGE) wireplay
        rm -rf /tmp/wireplay
        mv /tmp/$(DEVPACKAGE) ./releases/

.PHONY: install
install:
        mkdir -p /opt/wireplay/bin
        cp wireplay /opt/wireplay/bin/
        cp -r pcap /opt/wireplay/
        cp -r hooks /opt/wireplay/
gvelocity@lon3eur20:~/wireplay-read-only>

What version of the product are you using? On what operating system?

Latest SVN download

Please provide any additional information below.

Original issue reported on code.google.com by samkhop...@gmail.com on 17 Oct 2012 at 3:12

GoogleCodeExporter commented 9 years ago
The problem is resolved if I do "make shared" instead of "make static" for 
libnids and then link to shared so instead of .a

lrwxrwxrwx 1 gvelocity wheel     15 Oct 17 17:17 libnids.so -> libnids.so.1.23
-rwxr-xr-x 1 gvelocity wheel 151074 Oct 17 17:14 libnids.so.1.23

gvelocity@lon3eur20:~/wireplay-read-only> make
gcc -o wireplay src/wireplay.o src/log.o src/msg.o src/whook.o src/whook_rb.o 
-ggdb -L/home/gvelocity/wireplay-read-only/libnids-1.23/src/ -lnids -lpcap 
-lnet -L/usr/lib64 -lruby

Maybe it was just a LD_LIBRARY_PATH issue that libnids/src dir was missing

Original comment by samkhop...@gmail.com on 17 Oct 2012 at 3:19