delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
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" <edsinger AT ai DOT mit DOT edu> |
To: | <cygwin AT cygwin DOT com> |
Subject: | newbie linking problem |
Date: | Tue, 26 Nov 2002 12:41:11 -0500 |
Message-ID: | <COECKNPCJNKIBAJJAHLIAEGECMAA.edsinger@ai.mit.edu> |
MIME-Version: | 1.0 |
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 <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> ... display = XOpenDisplay(display_name); >>>serial.c: #include <fcntl.h> #include <termios.h> ... 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |