Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Aaron Edsinger" To: Subject: newbie linking problem Date: Tue, 26 Nov 2002 12:41:11 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Hi. i'm trying to link a simple program using X11 and a com port. the include and lib paths seem fine. The problem is with undefined references during linking: If in the makefile I link with static libraries (XLIB = ${XPATH}/lib/), I get lots of X related link errors such as: "xdisplay.c: undefined reference to '_XOpenDisplay'". If I switch to use dynamic libraries (XLIB = ${XPATH}/bin/), these errors go away. Why is this? On the serial side, I am getting a undefined reference link error on cfmakeraw() which is included from termios.h. This error I can not resolve. Any ideas? Thanks alot. -Aaron Makefile: ... # X stuff XPATH = /usr/X11R6 XINCLUDE = ${XPATH}/include XLIB = ${XPATH}/lib/ CC = gcc # All the object files ... alive: ${RABBIT} $(CC) -L${XLIB} -lm -lX11 -o alive ${RABBIT} serial.o: serial.c serial.h $(CC) -c serial.c xdisplay.o: xdisplay.c ${headers} $(CC) -I${XINCLUDE} -c xdisplay.c >>> Code xdisplay.c: #include #include #include ... display = XOpenDisplay(display_name); >>>serial.c: #include #include ... struct termios ti; ... cfmakeraw(&ti); -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/