LinuxQuestions.org
Help answer threads with 0 replies.
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 02-10-2010, 08:21 AM   #1
joyrock
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Rep: Reputation: 0
Thumbs up [solved] missing stropts.h(apue code compilation in Fedora11)


I want to compile the the source code given in a well known unix programming book(stevens) .I downloaded the codes but unable to build it ,giving me an error
error: stropts.h: No such file or directory
I don't know what to do....
I am using fedora 11 latest gcc in the system.
I also try to include the search path which include a file -I./usr/include/xulrunner-sdk-1.9.1/system_wrappers but it does not help . I open the header file and the definition is there #include_next<strops.h>
so ultimately there is not the original file...
any one please help..
--

Last edited by joyrock; 02-11-2010 at 12:40 PM. Reason: solved
 
Old 02-10-2010, 09:34 AM   #2
joyrock
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Original Poster
Rep: Reputation: 0
This problem is solved and a new arises
gcc -DLINUX -ansi -I/home/hirak/apue.2e/include -I/usr/arm-gp2x-linux/include -Wall -D_GNU_SOURCE -L../lib conf.c ../lib/libapue.a -o conf
/usr/lib/gcc/i586-redhat-linux/4.4.0/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'

I can't solve this without your help so pls..
 
Old 02-10-2010, 01:31 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
This one ? http://www.kohala.com/start/unpv12e.html
.. from 1998. Or this ? .. http://www.kohala.com/start/apue.html
.. 1992. Please specify book.

Twelwe year old code : some will compile OK, gcc-4.4.x
and some other will require fixing. ( Or gcc-2.95 ).

Please provide a link to the code, somebody may then
have an answer.
.....

Last edited by knudfl; 02-10-2010 at 01:35 PM.
 
Old 02-10-2010, 03:31 PM   #4
ForzaItalia2006
Member
 
Registered: Dec 2009
Location: Walldorf, Germany
Distribution: (X)Ubuntu, Arch, Gentoo
Posts: 205

Rep: Reputation: 67
[QUOTE=joyrock;3859116]gcc -DLINUX -ansi -I/home/hirak/apue.2e/include -I/usr/arm-gp2x-linux/include -Wall -D_GNU_SOURCE -L../lib conf.c ../lib/libapue.a -o conf
/usr/lib/gcc/i586-redhat-linux/4.4.0/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
QUOTE]

This error arises if your code does NOT define a main function as follows:

Code:
int main (int argc, char *argv[])
{
   // call your other functions
   return 0;
}
Alternatively, you could leave the parameters from main ...

- Andi -
 
Old 02-10-2010, 09:46 PM   #5
joyrock
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thank you guys the book is second edition the link the site
http://www.apuebook.com (here I downloaded the code)
and the problem is solved an error has occured whhile copying the file and its ok now,but I don't know why I can not run the programs
if any one has experience pls help me......
 
Old 02-11-2010, 12:37 PM   #6
joyrock
LQ Newbie
 
Registered: Mar 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Lightbulb

guys problem is solved

the command to compile a program is
Code:
$gcc -DLINUX -ansi -I/home/hirak/apue.2e/include -I/usr/arm-gp2x-linux/include -Wall -D_GNU_SOURCE   -L/home/hirak/apue.2e/lib  fig1.c -lapue  -o fig1
 
  


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
gl.pc missing shariefbe Linux - Software 2 01-13-2010 04:41 PM
FC10 - gftp compile fails with missing stropts.h - how to fix? rylan76 Linux - Software 3 03-03-2009 08:26 AM
missing stropts.h on Fedora 9 64-bit linux001 Fedora 2 11-06-2008 05:54 PM
missing jdbc isnt actually missing. trscookie Programming 0 06-04-2006 10:26 AM
Problem running UT Demo, Xlib missing on 0.0.. gldrv missing etc. RHLinuxGUY Linux - Games 3 05-21-2006 11:02 PM

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

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