473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Undefined reference to 'S_ISLINK'

Hi all,
I have to implement ls using system calls. The S_ISREG, S_ISDIR,
S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
error:

/tmp/ccWJ1Lbs.o: In function `longls':
ls.c:(.text+0x354): undefined reference to `S_ISLINK'
collect2: ld returned 1 exit status

In man pages it is written that this macro is 'Not in POSIX.1-1996'.
So does that mean my system isn't POSIX.1-1996? If so, how can I know
whether the file is a link? Can anyone help me out?

Jul 24 '07 #1
7 6269
In article <11*********************@z28g2000prd.googlegroups. com>,
<ga***************@gmail.comwrote:
>Hi all,
I have to implement ls using system calls. The S_ISREG, S_ISDIR,
S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
error:

/tmp/ccWJ1Lbs.o: In function `longls':
ls.c:(.text+0x354): undefined reference to `S_ISLINK'
collect2: ld returned 1 exit status

In man pages it is written that this macro is 'Not in POSIX.1-1996'.
So does that mean my system isn't POSIX.1-1996? If so, how can I know
whether the file is a link? Can anyone help me out?
Please do. Allow me to be the first in the feeding frenzy:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

Useful clc-related links:
--
http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

Jul 24 '07 #2
ga***************@gmail.com wrote:
Hi all,
I have to implement ls using system calls. The S_ISREG, S_ISDIR,
S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
error:

/tmp/ccWJ1Lbs.o: In function `longls':
ls.c:(.text+0x354): undefined reference to `S_ISLINK'
collect2: ld returned 1 exit status
Of course this is not about C but about un*x facilities,
so it would be better addressed somewhere like
comp.unix.programmer, really. However ...

<OT>
On my linux system this is S_ISLNK, with only one 'I'... I suspect
that's your problem...
</OT>
Jul 24 '07 #3
ga***************@gmail.com wrote:
I have to implement ls using system calls. The S_ISREG, S_ISDIR,
S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
error:
/tmp/ccWJ1Lbs.o: In function `longls':
ls.c:(.text+0x354): undefined reference to `S_ISLINK'
collect2: ld returned 1 exit status
In man pages it is written that this macro is 'Not in POSIX.1-1996'.
So does that mean my system isn't POSIX.1-1996? If so, how can I know
whether the file is a link? Can anyone help me out?
You better ask these kinds of questions in a UNIX newsgroup, e.g.
comp.unix.programmer, since these macros aren't part of the C but
of the POSIX standard, which isn't the same;-)

<OT>
Perhaps you should read the man page again and check if 'S_ISLINK'
is really spelled that way and not perhaps 'S_ISLNK' instead...
</OT>
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Jul 24 '07 #4
Mark Bluemel <ma**********@pobox.comwrites:
ga***************@gmail.com wrote:
>Hi all,
I have to implement ls using system calls. The S_ISREG, S_ISDIR,
S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
error:

/tmp/ccWJ1Lbs.o: In function `longls':
ls.c:(.text+0x354): undefined reference to `S_ISLINK'
collect2: ld returned 1 exit status

Of course this is not about C but about un*x facilities,
so it would be better addressed somewhere like
comp.unix.programmer, really. However ...

<OT>
On my linux system this is S_ISLNK, with only one 'I'... I suspect
that's your problem...
</OT>
Please guys, stop with the <OTtags. It is just *so* pathetic and
"jobsworth".

Jul 24 '07 #5
Jens Thoms Toerring wrote:
ga***************@gmail.com wrote:
>>I have to implement ls using system calls. The S_ISREG, S_ISDIR,
S_ISCHR etc. seem to be working fine. But S_ISLINK Is giving this
error:

<OT>
Perhaps you should read the man page again and check if 'S_ISLINK'
is really spelled that way and not perhaps 'S_ISLNK' instead...
</OT>
According to Brian Kernighan and Rob Pike: Ken Thompson was once asked
what he would do differently if he were redesigning the UNIX System.
His reply: "I'd spell creat with an e." (as related in a footnote in
"The UNIX Programming Environment" by K&P)
Jul 24 '07 #6
Richard wrote:
Please guys, stop with the <OTtags. It is just *so* pathetic and
^^
an interesting missing comma
"jobsworth".
Please, Richard, stop your inane attempts to destroy the topicality of
<news:comp.lang.c>. It is incredibly childish and suggests that you
need to find something, anything, positive to do with your life.
Jul 24 '07 #7
In article <5g*************@mid.individual.net>,
Martin Ambuhl <ma*****@earthlink.netwrote:
>Richard wrote:
>Please guys, stop with the <OTtags. It is just *so* pathetic and
^^
an interesting missing comma
>"jobsworth".

Please, Richard, stop your inane attempts to destroy the topicality of
<news:comp.lang.c>. It is incredibly childish and suggests that you
need to find something, anything, positive to do with your life.
Oh, the complete irony...

Jul 25 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on...
13
by: david | last post by:
Hi, I have some problems to link a simple hello world program using g++ (version 3.2.3 or 3.3) and dinkumware 402. //hallo world... #include <iostream> main () { std::cout << "bla" <<...
1
by: Codemutant | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** I just cannot find what is undefined in this code.
1
by: Foolster41 | last post by:
I'm rather new to C++ programing. I'm using the dev-C++ program on a windows XP OS. I'm trying to compile the code for a multi user dungeon (MUD) called circle-mud. When I compile I get the...
1
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no...
3
by: Michael Sgier | last post by:
Hi i get thousands of messages like below. How shall i resolve that? Thanks Mcihael Release/src/Utility/RawImage.o: In function `CMaskImage::CMaskImage(int, int, char const*)':...
45
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
3
by: prakash.mirji | last post by:
Hello, I am getting below mention linker error when I tried to link my class test.C I use below command to compile test.C /usr/bin/g++ -g -fpic -fvisibility=default -D_POSIX_SOURCE...
2
by: zqiang320 | last post by:
Hello: I execute make ,then get error: $ make Making all in libsbml/src make: Entering directory `/home/internet/mydoc/test_pj/libsbml/src' ........ /bin/sh ./libtool --tag=CC --mode=link...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.