[cs631apue] Persisting issues with strmode(3)

Jordan Scales jscales at stevens.edu
Sun Oct 13 15:57:09 EDT 2013


Perfect, thank you.

In order to develop on my Mac, I had to use a conditional in my Makefile.

UNAME := $(shell uname)

ifeq ($(UNAME), Linux)

all:
gcc -Wall compare.c storage.c options.c main.c -lbsd

else

all:
gcc -Wall compare.c storage.c options.c main.c

endif



On Sun, Oct 13, 2013 at 2:46 PM, hao wu <hwu9 at stevens.edu> wrote:

> please add -lbsd at the end of gcc command
>
> for example:
> gcc ............................ -lbsd
>
>
> On Sun, Oct 13, 2013 at 1:32 PM, Jordan Scales <jscales at stevens.edu>wrote:
>
>> Hi,
>>
>> I'm unable to find the original email in my inbox, but I am still having
>> difficulties with strmode(3) on the linux lab.
>>
>> jscales at gump:~/School/2013f/cs631/ls/jscales$ head ls.h
>> #include <fts.h>
>> #include <stdio.h>
>> #include <sys/types.h>
>> #include <sys/stat.h>
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>> #include <bsd/string.h>
>>
>>  #define SORT_MTIME 1
>> jscales at gump:~/School/2013f/cs631/ls/jscales$ make
>> gcc -Wall -lbsd compare.c storage.c options.c main.c
>> /tmp/ccLESyTm.o: In function `annotation_flag':
>> main.c:(.text+0x487): undefined reference to `strmode'
>> collect2: ld returned 1 exit status
>> make: *** [all] Error 1
>> jscales at gump:~/School/2013f/cs631/ls/jscales$
>>
>> I am linking the bsd library, but an ld error still pops up. Any ideas?
>>
>> Jordan
>>
>> _______________________________________________
>> 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/20131013/14e3f63b/attachment.html>


More information about the cs631apue mailing list