LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-04-2006, 03:05 PM   #1
wampire
LQ Newbie
 
Registered: Feb 2006
Posts: 16

Rep: Reputation: 0
gcc compile error?


Hello everybody
I have a problem about c compiling.Program has a few header files ,string.h,stdlib.h,libnet.h,ncurses.h ...
and I compiled this program with gcc but I takes a few error like this.I cant understand where the problem is...help me

linux:/home/wampire/programlama/c/tcp-ip # gcc gopack.c -o gopack /usr/lib/libnet.a -lncurses -lstring
gopack.c: In function ‘main’:
gopack.c:79: warning: pointer targets in passing argument 2 of ‘libnet_name2addr4’ differ in signedness
gopack.c:84: warning: pointer targets in passing argument 2 of ‘libnet_name2addr4’ differ in signedness
gopack.c:202:2: warning: no newline at end of file
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: cannot open output file gopack: Is a directory
collect2: ld returned 1 exit status
 
Old 05-04-2006, 03:52 PM   #2
burntfuse
Member
 
Registered: Sep 2005
Location: Laurel, MD, USA
Distribution: Slackware 10.1, FC5
Posts: 164

Rep: Reputation: 30
If it's not too large, could you post the source file? I could be completely wrong, but it looks like you're trying to pass a pointer to a signed int to libnet_name2addr4 when it requires an unsigned int, or something similar (could also be the other way around). It also seems that the file you're trying to output it to (gopack) is a directory - just give the binary a different name or rename the folder.
 
Old 05-06-2006, 05:17 PM   #3
Digital Surgeon
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Ubuntu 7.10 - Gutsy Gibbon(Desktop Edition)
Posts: 184

Rep: Reputation: 30
to get a good response type the code then the error msg you get, you have a lot of room on the post
 
Old 05-06-2006, 08:05 PM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
1. These are not errors, they're merely warnings:
Quote:
inux:/home/wampire/programlama/c/tcp-ip # gcc gopack.c -o gopack /usr/lib/libnet.a -lncurses -lstring
gopack.c: In function ‘main’:
gopack.c:79: warning: pointer targets in passing argument 2 of ‘libnet_name2addr4’ differ in signedness
gopack.c:84: warning: pointer targets in passing argument 2 of ‘libnet_name2addr4’ differ in signedness
<= TO UNDERSTAND THESE, YOU'D HAVE TO POST THE RELEVANT PARTS OF THE SOURE
2. This is just a warning, too. To fix it, simply add a blank line after the last source line in CODEgopack.c. Believe it or not, it's a legitimate warning (although it's very unlikely it would ever cause you a real problem):
Quote:
CODEgopack.c:202:2: warning: no newline at end of file
3. This is a real, bona fide error:
Quote:
linux:/home/wampire/programlama/c/tcp-ip # gcc gopack.c -o gopack /usr/lib/libnet.a -lncurses -lstring
...
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: cannot open output file gopack: Is a directory
collect2: ld returned 1 exit status
It looks like you've got a directory named "gopack" where the linker wants to create a new program file called "gopack". You can remove the directory, write the file someplace else, or rename the executable (e.g. "-o something_else").

'Hope that helps .. PSM

PS:
You seem to be logged in and compiling as "root" (the "#" prompt). Generally *not* a good practice...

Last edited by paulsm4; 05-06-2006 at 08:07 PM.
 
  


Reply

Tags
gcc, programming



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
Strange GCC compile error with C code exvor Programming 16 08-23-2005 06:05 PM
compile GCC 4.0 error! ayiiq180 Linux - Software 3 04-22-2005 04:04 PM
Screen resolution and gcc 3.3 kernel compile error bugsbunny Debian 6 03-07-2005 01:51 PM
compile error with gcc 3.3.2 on Mandrake 10 nboul Linux - Software 0 09-26-2004 06:53 PM
gcc-2.3.2 compile error rimo Linux From Scratch 33 07-30-2003 07:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:30 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