[cs631apue] Archive state?

Tejas Nadkarni tnadkarn at stevens.edu
Mon Oct 7 18:43:56 EDT 2013


Even on Linux-Lab when I try to compile including <bsd/string.h> and using
str_mode I get "undefined reference" error for str_mode. Am I supposed to
be using any flags with gcc or something?

I installed libbsd-dev on my Ubuntu VM and I get the same error there.
Undefined reference.

Any ideas?


On Mon, Oct 7, 2013 at 4:51 PM, Tejas Nadkarni <tnadkarn at stevens.edu> wrote:

> Thanks. I usually do the work on a local Ubuntu VM because it's faster
> than Linux Lab. Rarely have issues because the OS is same but I guess
> different packages and configs.
> On Oct 7, 2013 4:48 PM, "Jan Schaumann" <jschauma at stevens.edu> wrote:
>
>> Tejas Nadkarni <tnadkarn at stevens.edu> wrote:
>> > It's weird in the even on the manpage for strmode it doesn't reference
>> A or
>> > a being returned for filetype.
>>
>> Correct.  A platform that does not support these file types may not
>> mention them in its manual page.
>>
>> > Also I don't appear to have the bsd/string.h on my system so will need
>> to
>> > fix that. That's why since I already have a function written to parse
>> > st_mode I was hoping there was a value I could check for A or a.
>>
>> Well, if the platform supported this type, it'd probably provide macros
>> such as _S_ARCH1 an _S_ARCH2.  Your code would have to ifndef the
>> relevant blocks around this to be portable, though.  So in the end,
>> using strmode(3) is the best solution.
>>
>> This is also an example of why it's useful to develop your program on
>> the same platform on which it is intended to run --
>> linux-lab.cs.stevens.edu, in this case.  The differences across unix
>> variants can lead to frustrations otherwise.
>>
>> -Jan
>> _______________________________________________
>> cs631apue mailing list
>> cs631apue at lists.stevens.edu
>> https://lists.stevens.edu/mailman/listinfo/cs631apue
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20131007/b0401ccd/attachment.html>


More information about the cs631apue mailing list