LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 11-23-2004, 09:05 PM   #1
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
Where is 'errno' declared? How can I use it in my program?


I used errno in a funciton that main() calls and got an undeclared identifier compiler error. Should I declare errno? Isnt it already declared as an extern in each system funciton?
 
Old 11-23-2004, 10:14 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: At home: Arch, OpenBSD, Solaris. At work: CentOS, Debian, Ubuntu
Posts: 3,625

Rep: Reputation: 101Reputation: 101
Did you #include <errno.h> -- I'm not 100% sure (and too lazy to look it up), but I think you can only access erno in your program if you include this header, which has the declaration (or declare errno yourself, but probably best to include the header).
 
Old 11-24-2004, 06:45 AM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,524

Rep: Reputation: 93
Correct. Just #include <errno.h>
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to export variables declared in a script joehansen12 Linux - Newbie 2 10-26-2005 02:25 PM
errno cynthia Linux - Networking 3 09-24-2004 01:58 PM
How to use errno sibtay Programming 4 09-24-2004 09:38 AM
errno.h, but it IS declared...... privateprimate Linux - Software 3 09-08-2004 07:37 PM
Apache 2.0.35 declared stable jeremy Linux - General 4 04-10-2002 11:56 PM


All times are GMT -5. The time now is 06:09 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration