Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:44:41+00:00 2026-05-26T19:44:41+00:00

I am trying to build some simulation software using makefile provided by them after

  • 0

I am trying to build some simulation software using makefile provided by them after I have made some changes to the libraries. But when I run make clean, it stops midway and I get the following error


rm: invalid option -- 'l'
Try `rm --help' for more information.
make: *** [neat] Error 1

I checked the man page for rm and there is no -l option, but I don’t know why this command is being executed with -l option. Is there anyway to ignore this, or find out which specific file is causing the problem?

EDIT:

  • I have figured out the source of the error, but dont know how to edit it to make it work properly. Below is a snippet from an included Makefile with the faulty line:

    UDP_INTERFACE_SRCS = \
    $(UDP_INTERFACE_DIR)/interfaceudp_app.cpp \
    $(UDP_INTERFACE_DIR)/interfaceudp.cpp \
    $(UDP_INTERFACE_DIR)/external_interface_udp.cpp \
    $(UDP_INTERFACE_DIR)/packet_send.cpp \
    $(UDP_INTERFACE_DIR)/addr.cpp \
    $(UDP_INTERFACE_DIR)/packet_capture.cpp -lpcap \
    $(UDP_INTERFACE_DIR)/queue.cpp

In particular, the line: $(UDP_INTERFACE_DIR)/packet_capture.cpp -lpcap \
is causing the error. What does the “-lpcap” added after “packet_capture.cpp” do? Now if I try to remove it, “make” gives an error saying:

./interfaces/extinterface/src/packet_capture.o: In function pcap_sniff_packets(void*)': /home/qualnet/4.5/main/../interfaces/extinterface/src/packet_capture.cpp:63: undefined reference to pcap_setdirection' make: *** [../bin/qualnet] Error 1

I checked the line number 63 in packet_capture.cpp in an effort to understand what -lpcap means. But I have no idea what that code does.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:44:42+00:00Added an answer on May 26, 2026 at 7:44 pm

    (This is clearly an iterative process, and the comments are getting long, so I’d better start an answer.)

    You say: “When I put echo SIM_JOBS: $(SIM_OBJS) in the rule, i get the following when i run make clean: rm -f ../bin/qualnet ../bin/radio_range”

    This doesn’t make sense. You should get something like

    SIM_JOBS: ../bin/qualnet ../bin/radio_range
    rm -f ../bin/qualnet ../bin/radio_range
    

    or

    SIM_JOBS: something/else
    rm -f ../bin/qualnet ../bin/radio_range
    

    or at least

    SIM_JOBS:
    rm -f ../bin/qualnet ../bin/radio_range
    

    This suggests that you are looking at the wrong rule: the rule which produces rm -f ../bin/qualnet ../bin/radio_range is not the rule in which you put the echo ... command. If it is the rule and you were just being imprecise in the report, put this right above the clean rule:

    SIM_JOBS=../bin/qualnet ../bin/radio_range
    

    and tell us what happens.

    EDIT:

    1. Sorry, I wrote `SIM_JOBS` when I meant `SIM_OBJS`.
    2. The `echo` command was outside the rule, where it cannot work.
    3. It looks as if the problem. Could you edit your question to show the line you mentioned to @thiton, and a few previous lines? It looks as if the flag “-lpcap” is getting into a variable, where it doesn’t belong.

    EDIT:
    The “-lpcap” is a kludge. My guess is that it’s an option intended for the linker. Suppose you want to link a bunch of object files into an executable, and you want to search a certain library called “pcap”:

    gcc foo.o -lpcap bar.o baz.o
    

    The order is very important; when the linker is searching for something, you want it to search foo.o first, then pcap, then bar, then baz. It’s a question of precedence. But you want to store those filenames in a nice tidy variable, and how will you insert the lpcap at the right place? You could do it a good way, or use a lazy hack like this:

    OBJECTS = foo.o -lpcap bar.o baz.o
    gcc $(OBJECTS)
    

    And if you’re deducing the OBJECTS from the SOURCES, you have to put the hack in earlier:

    SOURCES = foo.cc -lpcap bar.cc baz.cc
    OBJECTS = $(SOURCES:.cc=.o)
    

    Whoever wrote these makefiles saved half an hour with this kludge, and it’s taking you days to fix it. If you can confirm that this is what’s happening, the easiest way is probably to split the list in two:

    SOURCES_LEFT = foo.cc
    SOURCES_RIGHT = bar.cc baz.cc
    OBJECTS_LEFT = $(SOURCES_LEFT:.cc=.o)
    OBJECTS_RIGHT = $(SOURCES_RIGHT:.cc=.o)
    gcc $(OBJECTS_LEFT) -lcap $(OBJECTS_RIGHT)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build firefox but I'm having some problems. I currently have Visual
I using rails3 and trying to build some complex associations. I have Product, Version
I'm trying to build my first generic list and have run into some problems.
I'm using a string builder to build some SQL Scripts. I have a few
I am trying to use the titanium developer v.1.2.1 but i have some difficulty
I'm trying to build some .ascx controls into a class library for plugins for
At the moment I'm trying to build some integration tests for an android project.
I am starting to I am learning scala, and trying to build some simple
I am trying to build an application to simulate some basic spheres moving around.
Hi I'm trying to build a layout where some shapes will popup every 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.