Libprelude with C++
Reinhard Fellner <[email protected]>
| Newsgroups | gmane.comp.security.ids.prelude.user |
|---|---|
| Message-ID | <[email protected]> |
Hello
Is it possible to use the libprelude with the g++ Compiler? I wrote some
Code in C++ which worked fine, but as soon as I tried to use the
idmef_message_read function, the linker produced an error. So I took the
code and tried it with the gcc and it worked fine. Is there a way to
change the Makefile to make the code work with C++ or do I have to write
all in C? Thanks for your help,
Kind regards,
Reinhard Fellner
Failure:
g++ -Wall -c connection.cpp
g++ -Wall -c corn.cpp
g++ -Wall -c main.cpp
g++ `libprelude-config --libs` -o corn connection.o corn.o main.o
connection.o: In function `Connection::run()':
connection.cpp:(.text+0x155): undefined reference to
`idmef_message_read(idmef_message*, prelude_msg*)'
collect2: ld returned 1 exit status
make: *** [corn] Error 1
Makefile:
OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
CC=g++
LD=g++
C_FLAGS= -Wall
LD_FLAGS= `libprelude-config --libs` -o $(EXECUTABLE)
EXECUTABLE= corn
$(EXECUTABLE) : $(OBJS)
$(LD) $(LD_FLAGS) $(OBJS)
%.o: %.cpp *.h
$(CC) $(C_FLAGS) -c $<
all : $(EXECUTABLE)
_______________________________________________
Prelude-user site list
[email protected]
http://www.prelude-ids.org/mailman/listinfo/prelude-user