Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
dear all,
i add new protocol (named Buddy) to ns. i create a folder named Buddy and put 3 files (Buddy.cpp, Buddy.h and Buddy_packet.h) in it.
after i run make command error below appers:
Buddy.h: packet.h no such file or directory
Buddy.h: ip.h no such file or direstory
the compiler cannot detect the header file used in Buddy.h, although all header files are existed.
You have not resolve the locations of packet.h and ip.h. Find out if you have those files on your system, and where they are located. You then can edit your Makefile to add references to the directories where those files are located.
Somewhere in your Makefile should be the call to gcc, something like:
Code:
gcc -Wall $(LIB) $(INC) -c Buddy.cpp
Earlier in the file may be something defining your include paths, like:
Code:
LIB=-L/usr/lib/
INC=-I/usr/include/
Fix those lines in your Makefile to match what your environment or system requires and this should resolve these problems.
Another option is to forgo make and call gcc from the command line. You still will have to find the directories where your include files are located, but the call will look something like this:
Makefile.txt
thanks for ur quick reply
i attached my makefile.
i only add Buddy/Buddy.o \ in line 336
i dont exactly know what should i add more than that.
is it possible to help me?
thanks
Dear, I add that line u mentioned but still have same errors
I insall the ns-allinone-2.35 in /usr/src/ns-allinone-2.35
and the Buddy folder is in /usr/src/ns-allinone-2.35/ns-2.35/Buddy
I need to compile my code, please please help me
thanx
Last edited by s.arzandeh; 07-09-2013 at 08:27 AM.
Reason: add an attachment
The first things to resolve are to get the locations of packet.h, ip.h, timer-handler.h, agent.h, config.h, and scheduler.h known in your system. Find the directories where those files are located and add those to the include path in your Makefile. Add those paths to the section in your Makefile titled INCLUDES.
thanks dear,
i check the location of ip.h or packet.h for instance and both of them locate in /usr/src/ns-allinone-2.35/ns-2.35/common and the common folder already exists in makefile (-I./common)
so why still i have problem?
Below is the INCLUDE definitions from the Makefile you sent before, the path you mention is not in this Makefile. ./common is not the same as /usr/src/ns-allinone-2.35/ns-2.35/common.
@rtmistler: i add the path of packet.h for instance into Makefile but still have same errors
@knudfl: after change <packet.h> to "packet.h" nothing changed also i run make depend and error below happend:
make: *** No rule to make target `Buddy/Buddy.cc', needed by `depend'. Stop.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.