On Sun, Jul 18, 2010 at 04:40:57PM -0400, Josh Rickmar wrote:
> 
> I'm having the following problem when building dmenu tip on OpenBSD
> current.  At first I thought it was a problem with OpenBSD, but a user
> in the irc channel said he remembers a similar problem when linking with
> ld on Linux.  Any ideas?
> 
> dmenu build options:
> CFLAGS   = -std=c99 -pedantic -Wall -Os -I. -I/usr/include 
> -I/usr/local/include -I/usr/X11R6/include -D_BSD_SOURCE -DVERSION="4.1.1" 
> LDFLAGS  = -s -L/usr/lib -L/usr/local/lib -lc -L/usr/X11R6/lib -lX11 -ldraw 
> CC       = cc
> CC dinput.c
> config.h:9: warning: 'spaceitem' defined but not used
> CC common.c
> config.h:9: warning: 'spaceitem' defined but not used
> CC -o dinput
> /usr/X11R6/lib/libX11.so.13.0: warning: strcpy() is almost always misused, 
> please use strlcpy()
> /usr/X11R6/lib/libX11.so.13.0: warning: strcat() is almost always misused, 
> please use strlcat()
> /usr/X11R6/lib/libX11.so.13.0: warning: sprintf() is often misused, please 
> use snprintf()
> /usr/lib/crt0.o(.text+0x9d): In function `___start':
> : undefined reference to `main'
> collect2: ld returned 1 exit status
> *** Error code 1
> 
> Stop in /home/joshua/src/dmenu (line 28 of Makefile)
> 
> 
Hello,

This is an old topic, I guess you solved it,
but as I didn't see the answer on the list and met
the same situation also on OpenBSD with latest dmenu tip :

$ make
dmenu build options:
CFLAGS   = -std=c99 -pedantic -Wall -Os -I/usr/X11R6/include -D_BSD_SOURCE 
-DVERSION="4.2.1" 
LDFLAGS  = -s -L/usr/X11R6/lib -lX11 
CC       = cc
CC -o dmenu
/usr/X11R6/lib/libX11.so.13.0: warning: strcpy() is almost always misused, 
please use strlcpy()
/usr/X11R6/lib/libX11.so.13.0: warning: sprintf() is often misused, please use 
snprintf()
/usr/X11R6/lib/libX11.so.13.0: warning: strcat() is almost always misused, 
please use strlcat()
/usr/lib/crt0.o(.text+0x93): In function `___start':
: undefined reference to `main'
collect2: ld returned 1 exit status
*** Error code 1

Revision 320 is in cause, reverting it fixes the issue.
patch attached


diff -up a/Makefile b/Makefile
--- a/Makefile	Tue Nov 30 23:57:15 2010
+++ b/Makefile	Wed Dec  1 00:12:11 2010
@@ -18,9 +18,9 @@ dmenu_path: dmenu_path.o
 	@echo CC -c $<
 	@${CC} -c $< ${CFLAGS}
 
-dmenu dmenu_path:
+.o:
 	@echo CC -o $@
-	@${CC} -o $@ $+ ${LDFLAGS}
+	@${CC} -o $@ $< draw.o ${LDFLAGS}
 
 clean:
 	@echo cleaning

Reply via email to