LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 02-27-2014, 07:09 PM   #1
Venet
LQ Newbie
 
Registered: Feb 2014
Posts: 6

Rep: Reputation: Disabled
Trouble compiling a .tgz with GCC compiler


Hello, I've been following the instructions to install a program.

So far, I've did everything but i eventually get stuck on when i have to compile the program 'stress' with the GCC compiler. I also updated to the latest compiler. I'm logged in as root.


When I insert either of the 2 below into Debian GNU(debian-7.0-x86) - I get the following errors;

Code:
gcc: error: stress.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.

The above 2 errors appear when i insert either one of the below;

Code:
gcc -Wall -c stress.c
gcc -pthread -o stress stress.o

If anyone can assist me with this problem further, contact me on skype via; @ eminem2ka9


Thank you =]

Last edited by Venet; 02-27-2014 at 07:11 PM.
 
Old 02-27-2014, 09:52 PM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733
The error says there's no such file or directory. This leads me to believe that you may have attempted to run gcc against a file or directory that does not exist in your current location.

From what directory (provide full path please) are you attempting to execute the command?

And also, why are you using gcc directly? does `stress` not come with a Makefile or some kind of inbuilt build system?
 
1 members found this post helpful.
Old 02-27-2014, 09:53 PM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675

Rep: Reputation: Disabled
Furthermore, there is Debian package stress. Why are you trying to build it by hand?
 
Old 02-27-2014, 09:55 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
show me the output of:

Code:
ls
pwd
And I'll show you files not existing, or permission issues.
 
Old 02-27-2014, 10:25 PM   #5
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by Venet View Post
Hello, I've been following the instructions to install a program.
Would be a good idea to provide a link to those instructions.
We will get a better picture of what it is you are trying to achieve.
 
Old 02-28-2014, 12:34 PM   #6
Venet
LQ Newbie
 
Registered: Feb 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
show me the output of:

Code:
ls
pwd
And I'll show you files not existing, or permission issues.
Output of 'ls'; http://prntscr.com/2wn5c0
Output of 'pwd'; root/sockstress (Though now I'm pretty sure I used 'make' which was built in, so no need for the compiler now?

Instructions are here; http://samsclass.info/123/proj10/sockstress.htm

OR; https://defuse.ca/sockstress.htm

I tried to insert a command, but; http://prntscr.com/2wn9ku

I used 'sudo' before the command, and the abort never appeared then, but still everything above it did.

Last edited by Venet; 02-28-2014 at 12:35 PM.
 
Old 02-28-2014, 12:49 PM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Look at your directory listing more closely, and youll see that there is no sockstress.c to compile. it looks like a binary called 'sockstress' already.

Ie: You cant use gcc to compile something that is already compiled.

Just run './sockstress'
 
Old 02-28-2014, 12:58 PM   #8
Venet
LQ Newbie
 
Registered: Feb 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
Look at your directory listing more closely, and youll see that there is no sockstress.c to compile. it looks like a binary called 'sockstress' already.

Ie: You cant use gcc to compile something that is already compiled.

Just run './sockstress'
I've already tried to run ./sockstress = http://prntscr.com/2wnir3
 
Old 03-01-2014, 01:02 AM   #9
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733
What Linux system are you using? I'm assuming you're ssh'd in to something.

Sockstress compiles and runs fine for me. What copy of the source code did you download? your source folder looks nothing like what I see. Go to the github link and download a copy of the latest version, then perform a `make` and then run it.
 
1 members found this post helpful.
Old 03-01-2014, 11:09 AM   #10
Venet
LQ Newbie
 
Registered: Feb 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by notKlaatu View Post
What Linux system are you using? I'm assuming you're ssh'd in to something.

Sockstress compiles and runs fine for me. What copy of the source code did you download? your source folder looks nothing like what I see. Go to the github link and download a copy of the latest version, then perform a `make` and then run it.
I've tried this on ubuntu, and debian. You have centos?

And yes, I'm using SSH connection(putty). I downloaded the source just now(github) - the same thing occurs.

1) I typed "wget https://github.com/defuse/sockstress/archive/master.zip"
2) Then i typed "cd sockstress"
3) Then i typed "make" - http://prntscr.com/2wx9e4
4) But If i typed "./sockstress", I'd only get an "buffer overflow detected - ./sockstress terminated" - http://prntscr.com/2wxamp
 
Old 03-02-2014, 12:24 AM   #11
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733
Quote:
Originally Posted by Venet View Post
1) I typed "wget https://github.com/defuse/sockstress/archive/master.zip"
2) Then i typed "cd sockstress"
3) Then i typed "make" - http://prntscr.com/2wx9e4
4) But If i typed "./sockstress", I'd only get an "buffer overflow detected - ./sockstress terminated" -
If that is literally what you did, you have done something wrong.

1. wget command looks ok

But you did not unzip the archive you downloaded, according to you. Here's what I would do :

mkdir ~/src
wget blahblah/master.zip
unzip *.zip -d ~/src (that unzips the master.zip file into the src directory)
cd ~/src
ls (just to make sure you see the files you need)
pwd (to make sure you're where you think you are)
make
./sockstress
 
1 members found this post helpful.
Old 03-02-2014, 12:27 AM   #12
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733
I should also add, and I do not mean this in a pedantic way, that you ought to consider using Linux more often, as your primary OS. To get really good at the stuff you are doing in that course, knowing Linux would be invaluable and it would make all those commands and the logic of those commands make a lot more sense. I know using Linux is frustrating if you're really good on Windows, as you probably are, but after the initial learning curve, you have so much at your disposal. An t's free, after all, so the only real investment is the learning part. But it looks like you're ok with learning new stuff, since you're taking that course.

Just my thoughts. Again, not attempting to patronize you.
 
1 members found this post helpful.
Old 03-02-2014, 12:15 PM   #13
Venet
LQ Newbie
 
Registered: Feb 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Okay Everything looks grand! Thank you man =]

You're helpfulness is most appreciated by me.

I'm using this to test on my hosted website for vulnerabilities test purposes, so which command would be most effective?

Last edited by Venet; 03-02-2014 at 12:28 PM.
 
Old 03-02-2014, 02:06 PM   #14
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733
I wasn't thinking of one command in particular; just saying that 1) if you know your way around a unix shell, then 2) testing for vulns is easier because you know your way around a unix shell, and 3) the way to learn your way around a shell is to use a shell, ergo 4) use unix often.

Anyway, glad it worked for you! If you go to the top of this thread > Thread Tools > Mark Thread as Solved, that'll close this thread. Also, if you found my advice helpful, mark 'yes' to "did you find this response helpful?"

Good luck, mate!
 
1 members found this post helpful.
Old 03-02-2014, 03:47 PM   #15
Venet
LQ Newbie
 
Registered: Feb 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Right, voted and 1 more thing;

Do you know how to add payload?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Compiling 8 bit code using gcc compiler ravi_chobey Linux - Embedded & Single-board computer 6 10-18-2012 08:56 AM
GCC compiler error while compiling *.c file ssvirdi Programming 12 11-26-2011 12:24 PM
Trouble with gcc compiler on arm platform meda75 Linux - Newbie 6 03-14-2009 11:51 AM
Compiling gcc without compiler? davuuud Linux - Software 6 02-03-2009 11:16 AM
compiling x64 application from ubuntu x86 using gcc compiler samitpmc Programming 9 07-21-2008 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:03 PM.

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