5g-network-emulator icon indicating copy to clipboard operation
5g-network-emulator copied to clipboard

Build error : libnetfilter-queue-dev

Open khand-hey opened this issue 1 year ago • 7 comments

Hello, I'm a computer networks student working on a project to evaluate the MP-QUIC protocol on drones with 5G. While trying to build the emulator on Ubuntu 22.04.03 using the makefile, I ran into this error :

g++ -O3 -std=c++11 -pthread -lmnl -lnetfilter_queue -Iinclude -o bin/netfilter.o -c src/netfilter/netfilter_interface.cpp src/netfilter/netfilter_interface.cpp:234:1: error: ‘nlmsghdr* nfq_nlmsg_put(char*, int, uint32_t)’ was declared ‘extern’ and later ‘static’ [-fpermissive] 234 | nfq_nlmsg_put(char *buf, int type, uint32_t queue_num) | ^~~~~~~~~~~~~

In file included from src/netfilter/netfilter_interface.cpp:20: /usr/include/libnetfilter_queue/libnetfilter_queue.h:153:18: note: previous declaration of ‘nlmsghdr* nfq_nlmsg_put(char*, int, uint32_t)’ 153 | struct nlmsghdr *nfq_nlmsg_put(char *buf, int type, uint32_t queue_num); | ^~~~~~~~~~~~~ make: *** [Makefile:38 : netfilter.o] Erreur 1

If you have a moment, any ideas on how to fix this would be awesome.

Best Regards,

KHand

khand-hey avatar Nov 20 '23 19:11 khand-hey

Same issue for me. Is there a solution?

NKSuryadevara avatar Apr 11 '24 05:04 NKSuryadevara

Same issue for me. Did you guys find anything helpful?

ejim037 avatar Jun 19 '24 10:06 ejim037

Hello,

It seems that the error may be due to having an inappropriate version of the lpackage libnetfilter-queue1. You should have a libnetfilter_queue version < 1.0.4 version for the build works correctly. Can you try if this solution helps you?

Best Regards.

nuriaoyaga avatar Jun 20 '24 12:06 nuriaoyaga

Hi there,

We've installed a libnetfilter_queue version < 1.0.4 (more precisely 1.0.3) and it does not work either.

This is the output of the make command: tsr@scaphandre:~/5g-network-emulator$ make mkdir -p bin
g++ -O3 -std=c++11 -pthread -lmnl -lnetfilter_queue -Iinclude -o bin/netfilter.o -c src/netfilter/netfilter_interface.cpp g++ -O3 -std=c++11 -pthread -lmnl -lnetfilter_queue -Iinclude -o bin/main.o -c main.cpp g++ -O3 -std=c++11 -pthread -lmnl -lnetfilter_queue -g src/mac_layer/harq_handler.cpp src/mac_layer/mac_layer.cpp src/mac_layer/metric_handler.cpp src/mac_layer/resource_block.cpp src/mac_layer/resource_grid.cpp src/mobility_models/mobility_model_base.cpp src/mobility_models/pos2d.cpp src/pdcp_layer/ip_buffer.cpp src/pdcp_layer/pdcp_handler.cpp src/pdcp_layer/pdcp_layer.cpp src/pdcp_layer/release_handler.cpp src/phy_layer/phy_handler.cpp src/phy_layer/phy_layer.cpp src/ue/ue.cpp -Iinclude bin/main.o bin/netfilter.o -pthread -lmnl -lnetfilter_queue -o bin/fikore

So, according to the Makefile and the installation/compilation usage guide, inside the bin folder there should be a main exec. After that make output, there is not a main executable file. Maybe something related to the Makefile?

Thanks Nuria!

Erick

ejim037 avatar Jun 21 '24 08:06 ejim037

Hello Erick,

I'm trying to figure out what could happen. In the output of the make there is no error, do you get any errors? Indeed, if the compilation has gone correctly, a "fikore" executable file should be created in "bin" folder. In the image you can check what the "bin" folder should contain if everything has gone correctly.

image

nuriaoyaga avatar Jun 25 '24 09:06 nuriaoyaga

Nuria, thanks for the comment. Somehow we managed to get something like that!

By the way, how can I access the PCAP files for XR? I've read all of the related papers (good job!) and that address that you mention in the GitHub is not available anymore. Thanks again!

Erick

ejim037 avatar Jun 26 '24 08:06 ejim037

[SOLVED] Here is how I solved it.

Cause of the Problem The libnetfilter-queue-dev=1.0.3 requires libnetfilter-queue1=1.0.3 which is available on Ubuntu 20.04 LTS (FOCAL) distribution. Therefore, if you try to install that version on a newer Ubuntu distro, it would raise a Version Unavailable error.

Solution Download the deb files using wget <URL> then install them with dpkg -i <FILE_NAME>

  1. libnetfilter-queue1=1.0.3
  2. libnetfilter-queue-dev=1.0.3

Summary

wget  http://archive.ubuntu.com/ubuntu/pool/universe/libn/libnetfilter-queue/libnetfilter-queue-dev_1.0.3-1_amd64.deb
wget  http://archive.ubuntu.com/ubuntu/pool/universe/libn/libnetfilter-queue/libnetfilter-queue1_1.0.3-1_amd64.deb
sudo dpkg -i libnetfilter-queue1_1.0.3-1_amd64.deb
sudo dpkg -i libnetfilter-queue-dev_1.0.3-1_amd64.deb
sudo apt -y install libmnl-dev make g++ git
git clone https://github.com/nokia/5g-network-emulator.git
cd 5g-network-emulator
make

RishiCSE128 avatar Jul 09 '24 13:07 RishiCSE128