LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 04-13-2016, 04:41 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
C code experts needed


I have some source code that I want to compile.

Installation
------------
./configure
make
make install

Code:
# ./configure
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for pcap_open_live in -lpcap... yes
checking for pthread_mutex_lock in -lpthread... yes
checking for libnet_init_packet in -lnet... no
configure: error: libnet0 (dev) is required for this program
 
Old 04-13-2016, 04:57 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
./configure cannot find the lnet routine. You can find lnet here:

https://lnet.wordpress.com

and download it here:

https://lnet.wordpress.com/download/

---------------------
Steve Stites
 
Old 04-13-2016, 05:02 PM   #3
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
It needed the libnet library which I found.

I compiled it with no errors.

Do I then put all those files in the same dir as my source code and then start again ?
 
Old 04-14-2016, 03:55 AM   #4
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
Probably no. First of all, make sure that your distro (Puppy here I guess) does not provide libnet, it's always better to install software from official distro repository than doing it manually. If you're sure that you have to install libnet by hand do this after compiling it:
Code:
sudo make install
It will install a library on your system, now you can try compiling program you tried in your first post.
In practice, I don't recommend using pure 'make install' solution. It will be hard to remove a library installed that way and it will not be shown in the list of installed packages. It would be better to create a system package from it and install it as all other packages.
 
Old 04-14-2016, 08:14 AM   #5
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I did all three of these as per the readme file.
But where is the executable that it produced ?

Installation
------------
./configure
make
make install

Quote:
# make install
Making install in include
make[1]: Entering directory `/root/TEMP/ddosim-0.2/include'
Making install in libnet
make[2]: Entering directory `/root/TEMP/ddosim-0.2/include/libnet'
make[3]: Entering directory `/root/TEMP/ddosim-0.2/include/libnet'
make[3]: Nothing to be done for `install-exec-am'.
/bin/sh ../../mkinstalldirs /usr/include/libnet
/usr/bin/ginstall -c -m 644 libnet-asn1.h /usr/include/libnet/libnet-asn1.h
/usr/bin/ginstall -c -m 644 libnet-functions.h /usr/include/libnet/libnet-functions.h
/usr/bin/ginstall -c -m 644 libnet-headers.h /usr/include/libnet/libnet-headers.h
/usr/bin/ginstall -c -m 644 libnet-macros.h /usr/include/libnet/libnet-macros.h
/usr/bin/ginstall -c -m 644 libnet-structures.h /usr/include/libnet/libnet-structures.h
/usr/bin/ginstall -c -m 644 libnet-types.h /usr/include/libnet/libnet-types.h
make[3]: Leaving directory `/root/TEMP/ddosim-0.2/include/libnet'
make[2]: Leaving directory `/root/TEMP/ddosim-0.2/include/libnet'
make[2]: Entering directory `/root/TEMP/ddosim-0.2/include'
make[3]: Entering directory `/root/TEMP/ddosim-0.2/include'
make[3]: Nothing to be done for `install-exec-am'.
/bin/sh ../mkinstalldirs /usr/include
/usr/bin/ginstall -c -m 644 libnet.h /usr/include/libnet.h
make[3]: Leaving directory `/root/TEMP/ddosim-0.2/include'
make[2]: Leaving directory `/root/TEMP/ddosim-0.2/include'
make[1]: Leaving directory `/root/TEMP/ddosim-0.2/include'
Making install in src
make[1]: Entering directory `/root/TEMP/ddosim-0.2/src'
make[2]: Entering directory `/root/TEMP/ddosim-0.2/src'
/bin/sh ../mkinstalldirs /usr/lib
/usr/bin/ginstall -c -m 644 libnet.a /usr/lib/libnet.a
ranlib /usr/lib/libnet.a
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/TEMP/ddosim-0.2/src'
make[1]: Leaving directory `/root/TEMP/ddosim-0.2/src'
Making install in sample
make[1]: Entering directory `/root/TEMP/ddosim-0.2/sample'
make[2]: Entering directory `/root/TEMP/ddosim-0.2/sample'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/TEMP/ddosim-0.2/sample'
make[1]: Leaving directory `/root/TEMP/ddosim-0.2/sample'
make[1]: Entering directory `/root/TEMP/ddosim-0.2'
make[2]: Entering directory `/root/TEMP/ddosim-0.2'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/TEMP/ddosim-0.2'
make[1]: Leaving directory `/root/TEMP/ddosim-0.2'
#
 
Old 04-15-2016, 02:59 AM   #6
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
Libraries are not executables - you cannot run them. They are "shared objects" and are loaded by executables on demand. Now when you installed libnet its .so binary is already on your system - probably in /usr/local/lib/libnet.so. You can now recompiling your original program.
 
Old 04-15-2016, 03:31 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,944

Rep: Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324
/usr/bin/ginstall -c -m 644 libnet.a /usr/lib/libnet.a
here is it
 
Old 04-15-2016, 10:54 AM   #8
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
ddosim is the exe that I was looking for.

That's O.K.

I'll move on.
 
Old 04-15-2016, 03:06 PM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
To parallel what average_user and pan64 are saying, the process of "make" followed by "make install" and typically you may do "sudo make install" however I sense that you're root when I see the "#" prompt anyways.

Either case, the "make install" portion should resolve placing the executable into a common system path, maybe /bin, /sbin, /usr/bin, or /usr/sbin, or it may choose to place it in a custom directory of it's own choice. At which point their README or other documentation may inform you to add that executable tree to your path variable.

I think you're understanding that the ./configure step ensures that your environment and machine are properly set up and contain the proper prerequisites to be able to build the project. The make step performs the actual compile and link. And the make install step sets it up for use, and that would be to install a library if it was a library, or to place the executable into the intended destination directory.

Glad you got it resolved.
 
Old 04-15-2016, 03:25 PM   #10
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I did not get it resolved, but have accepted that I can not always understand everything I would like.

I did a search for ddosim* and did not find anything that looked like an executable.

I would like to find an example that does work.

I did a search for "linux c programming forums", but did not find much that was helpful.

When I did Windows programming, I used a gui environment to assemble and link programs.

It basically used bat files in the background.

Last edited by Fixit7; 04-15-2016 at 03:28 PM.
 
Old 04-15-2016, 03:48 PM   #11
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Now wait a minute. Sorry I thought you were all set. Why give up if you are very close?

First thing was you needed to get the libnet library compiled and installed. I kind of figured when you said you needed the ddosim that you had completed getting the library, and then got back to ./configure, make, and make install of your original application and been successful.

After completing the libnet compile and install ... firstly, did you get libnet compiled and installed?

And then after that you'd next go back to the original actions to build what you first were building, which likely gives you ddosim. From what I'm seeing, it seems as if you did do that next step.

How about typing "which ddosim"?

Or if you feel there may be additional stuff after that name string, and because you typed "ddosim*", then try typing "ddosim[TAB]" to see if command completion shows you that utility.

Note you can re-do the make install command and then look at the output showing what it does. Likely you'll see the directories which it uses, etc and the files it sets up, as well as any symbolic links. You could also save stdout and stderr to a text file so that it all doesn't steam beyond your terminal window limit.
 
Old 04-15-2016, 04:08 PM   #12
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by rtmistler View Post
Now wait a minute. Sorry I thought you were all set. Why give up if you are very close?

First thing was you needed to get the libnet library compiled and installed. I kind of figured when you said you needed the ddosim that you had completed getting the library, and then got back to ./configure, make, and make install of your original application and been successful.

After completing the libnet compile and install ... firstly, did you get libnet compiled and installed?

And then after that you'd next go back to the original actions to build what you first were building, which likely gives you ddosim. From what I'm seeing, it seems as if you did do that next step.

How about typing "which ddosim"?

Or if you feel there may be additional stuff after that name string, and because you typed "ddosim*", then try typing "ddosim[TAB]" to see if command completion shows you that utility.

Note you can re-do the make install command and then look at the output showing what it does. Likely you'll see the directories which it uses, etc and the files it sets up, as well as any symbolic links. You could also save stdout and stderr to a text file so that it all doesn't steam beyond your terminal window limit.
Let's break this into 2 parts.

The libnet library and ddosim which uses libnet.

I had the libnet in a separate directory.

But I moved it to the directory that has the ddosim souce code to make things easier.

Do I need to recompile libnet now ?
 
Old 04-16-2016, 12:27 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,944

Rep: Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324Reputation: 7324
libnet and ddosim are two different "products", both of them have a build environment. Copying that directory will not produce a common environment. Therefore your configure, make, make install commands created libnet.a but nothing related to ddosim. You need to configure, make, make install it too.
 
Old 04-16-2016, 01:21 AM   #14
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622
Blog Entries: 40

Rep: Reputation: Disabled
Has someone already mentioned the difficulty of managing these self-build programs and libraries in the future?
How will you keep track of the changes made to your system upon calling “make install”?

I happen to have written a blog entry a few days ago, on the topic of the “PORG” package-organizer which is just a proposition.

Last edited by Michael Uplawski; 04-16-2016 at 05:47 AM. Reason: not accidentally
 
Old 04-16-2016, 07:51 AM   #15
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Quote:
Originally Posted by pan64 View Post
libnet and ddosim are two different "products", both of them have a build environment. Copying that directory will not produce a common environment. Therefore your configure, make, make install commands created libnet.a but nothing related to ddosim. You need to configure, make, make install it too.
I have done so.

What do I do now ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ifconfig experts needed johnitravolta Linux - Networking 4 08-24-2014 05:47 PM
HD hardware failure, dd experts needed. Linux.tar.gz Linux - Hardware 6 12-29-2013 07:31 PM
[SOLVED] Calling all experts... NDISWRAPPER help needed! lpshark Linux - Wireless Networking 14 03-30-2007 01:38 PM
Makefile help from experts needed markelo Programming 0 07-23-2006 01:13 PM
awk experts help needed ferreirafm Linux - General 2 07-28-2004 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration