Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#15941 closed defect (invalid)

mjpegtools build error: ld: library not found for -lX11

Reported by: mroman@… Owned by: filippo.natali@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: mjpegtools

Description

I am not expirenced unix user, but on my machine there is bug while compiling mjpegtools:

Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_mjpegtools/work/mjpegtools-1.6.2" && make all LIBTOOL=/opt/local/bin/glibtool ASFLAGS="-f macho" " returned error 2
Command output: if /opt/local/bin/glibtool --mode=compile /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"lavtools\" -DLAVPLAY_VERSION=\"1.6.2\" -I/usr/local/include   -I /usr/X11R6/include -I../utils    -I/opt/local/include -L/opt/local/lib  -O2 -L/opt/local/lib -Wall -Wunused -MT liblavplay_la-audiolib.lo -MD -MP -MF ".deps/liblavplay_la-audiolib.Tpo" \
	  -c -o liblavplay_la-audiolib.lo `test -f 'audiolib.c' || echo './'`audiolib.c; \
	then mv -f ".deps/liblavplay_la-audiolib.Tpo" ".deps/liblavplay_la-audiolib.Plo"; \
	else rm -f ".deps/liblavplay_la-audiolib.Tpo"; exit 1; \
	fi
 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"lavtools\" -DLAVPLAY_VERSION=\"1.6.2\" -I/usr/local/include -I /usr/X11R6/include -I../utils -I/opt/local/include -L/opt/local/lib -O2 -L/opt/local/lib -Wall -Wunused -MT liblavplay_la-audiolib.lo -MD -MP -MF .deps/liblavplay_la-audiolib.Tpo -c audiolib.c  -fno-common -DPIC -o .libs/liblavplay_la-audiolib.o
audiolib.c:634: warning: 'system_error' defined but not used
 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"lavtools\" -DLAVPLAY_VERSION=\"1.6.2\" -I/usr/local/include -I /usr/X11R6/include -I../utils -I/opt/local/include -L/opt/local/lib -O2 -L/opt/local/lib -Wall -Wunused -MT liblavplay_la-audiolib.lo -MD -MP -MF .deps/liblavplay_la-audiolib.Tpo -c audiolib.c -o liblavplay_la-audiolib.o >/dev/null 2>&1
/opt/local/bin/glibtool --mode=link /usr/bin/gcc-4.0  -O2 -L/opt/local/lib -Wall -Wunused  -L/opt/local/lib -o liblavplay.la -rpath /opt/local/lib -version-info 2:2:2 -export-dynamic  liblavplay_la-liblavplay.lo liblavplay_la-audiolib.lo  
/usr/bin/gcc-4.0 -dynamiclib ${wl}-undefined ${wl}dynamic_lookup -o .libs/liblavplay.0.2.2.dylib  .libs/liblavplay_la-liblavplay.o .libs/liblavplay_la-audiolib.o  -L/opt/local/lib  -install_name  /opt/local/lib/liblavplay.0.dylib -compatibility_version 3 -current_version 3.2 -Wl,-single_module
dsymutil .libs/liblavplay.0.2.2.dylib || :
warning: no debug symbols in executable (-arch i386)
(cd .libs && rm -f liblavplay.0.dylib && ln -s liblavplay.0.2.2.dylib liblavplay.0.dylib)
(cd .libs && rm -f liblavplay.dylib && ln -s liblavplay.0.2.2.dylib liblavplay.dylib)
ar cru .libs/liblavplay.a  liblavplay_la-liblavplay.o liblavplay_la-audiolib.o
ranlib .libs/liblavplay.a
creating liblavplay.la
(cd .libs && rm -f liblavplay.la && ln -s ../liblavplay.la liblavplay.la)
if /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"lavtools\" -DLAVPLAY_VERSION=\"1.6.2\" -I/usr/local/include   -I /usr/X11R6/include -I../utils    -I/opt/local/include -L/opt/local/lib  -O2 -L/opt/local/lib -Wall -Wunused -MT lavplay.o -MD -MP -MF ".deps/lavplay.Tpo" \
	  -c -o lavplay.o `test -f 'lavplay.c' || echo './'`lavplay.c; \
	then mv -f ".deps/lavplay.Tpo" ".deps/lavplay.Po"; \
	else rm -f ".deps/lavplay.Tpo"; exit 1; \
	fi
/opt/local/bin/glibtool --mode=link /usr/bin/gcc-4.0  -O2 -L/opt/local/lib -Wall -Wunused  -L/opt/local/lib -o lavplay  lavplay.o ../utils/libmjpegutils.a liblavplay.la liblavjpeg.la liblavfile.la -lpthread -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa  -lX11 
/usr/bin/gcc-4.0 -O2 -Wall -Wunused -o .libs/lavplay lavplay.o -Wl,-framework -Wl,Cocoa  -L/opt/local/lib ../utils/libmjpegutils.a ./.libs/liblavplay.dylib ./.libs/liblavjpeg.dylib ./.libs/liblavfile.dylib /opt/local/lib/libjpeg.dylib -L/usr/local/lib /opt/local/lib/libdv.dylib -lm /opt/local/lib/libglib.dylib -lpthread -lSDLmain /opt/local/lib/libSDL.dylib -lX11 
ld: library not found for -lX11
collect2: ld returned 1 exit status
make[2]: *** [lavplay] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I managed to compile this app, by modifying portfile.

Attachments (1)

mjpegtools.diff (707 bytes) - added by mroman@… 16 years ago.

Download all attachments as: .zip

Change History (14)

Changed 16 years ago by mroman@…

Attachment: mjpegtools.diff added

comment:1 Changed 16 years ago by jmroot (Joshua Root)

What's the deal with a -L being added to CPPFLAGS and not LDFLAGS in the first place?

comment:2 Changed 16 years ago by mroman@…

I think it's connected with makefile. Changing to ldflags doesn't fix this problem.

comment:3 Changed 16 years ago by mroman@…

I have only added "-L${x11prefix}/lib" to configure.cppflags-append.

comment:4 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… wsiegrist@… dsh@… jason@… keithpk@… chosenken@… Gordon.Child@… added; filippo.natali@… removed
Owner: changed from macports-tickets@… to filippo.natali@…
Priority: LowNormal
Summary: mjpegtools 1.6.2,mjpegtools build error: ld: library not found for -lX11

I'm unable to reproduce the problem on two MacBooks Pro, one running Mac OS X 10.5.4 with Xcode 3.1 and one running Mac OS X 10.4.11 with Xcode 2.5. On both, mjpegtools 1.6.2_2 installs without error. What version of Mac OS X, Xcode and MacPorts do you have, and on what kind of Mac? What ports are already installed?

I see a number of problems in the line just above the error:

  1. mjpegtools is looking for libraries in /usr/local/lib. Do you have any libraries in /usr/local/lib? If so you should remove them before using MacPorts.
  2. mjpegtools is linking with /opt/local/lib/libdv.dylib. I don't have that on my system and I don't know what port provides it. Can you show us the output of "port provides /opt/local/lib/libdv.dylib" please?
  3. mjpegtools is linking with /opt/local/lib/libglib.dylib which is provided by glib1 but mjpegtools doesn't declare a dependency on glib1.
  4. mjpegtools is linking with /opt/local/lib/libSDL.dylib which is provided by libsdl but mjpegtools doesn't declare a dependency on libsdl.

mjpegtools should either declare dependencies on all the libraries it links with, or configure arguments should be added to force mjpegtools not to link with those libraries if they're present.

comment:5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: wsiegrist@… dsh@… jason@… keithpk@… chosenken@… Gordon.Child@… removed

comment:6 Changed 16 years ago by mroman@…

1.

aspell-0.60		libcdt.4.dylib		libgvc.4.dylib
codecs			libcdt.dylib		libgvc.dylib
graphviz		libcdt.la		libgvc.la
libagraph.4.0.0.dylib	libcgraph.4.0.0.dylib	libpathplan.4.0.0.dylib
libagraph.4.dylib	libcgraph.4.dylib	libpathplan.4.dylib
libagraph.dylib		libcgraph.dylib		libpathplan.dylib
libagraph.la		libcgraph.la		libpathplan.la
libaspell.15.1.4.dylib	libgraph.4.0.0.dylib	libpspell.15.1.4.dylib
libaspell.15.dylib	libgraph.4.dylib	libpspell.15.dylib
libaspell.dylib		libgraph.dylib		libpspell.dylib
libaspell.la		libgraph.la		libpspell.la
libcdt.4.0.0.dylib	libgvc.4.0.0.dylib	pkgconfig

I didn't know, that /usr/local/lib should be empty. These libs were probably installed with some .pkg's. Do I really need to move them elsewhere?

2.

/opt/local/lib/libdv.dylib is provided by: libdv
port dependents libdv
MPlayer depends on libdv

3,4.

mjpegtools @1.6.2_2+darwin_9 (active)

MacPorts 1.600
OSX 10.5.4  MBP1,1
Xcode 3.1
Component versions: DevToolsCore-1100.0; DevToolsSupport-1086.0
BuildVersion: 9M2199
The following ports are currently installed:
  a52dec @0.7.4_0 (active)
  aalib @1.4rc5_3 (active)
  atk @1.22.0_1 (active)
  audiofile @0.2.6_2 (active)
  autoconf @2.62_0 (active)
  automake @1.10.1_0 (active)
  base64 @1.3_0 (active)
  bash-completion @20060301_1 (active)
  boost-jam @3.1.16_0 (active)
  bzip2 @1.0.5_1 (active)
  cairo @1.6.4_1+no_x11 (active)
  checkdns @0.5_0 (active)
  curl @7.18.2_0 (active)
  curlftpfs @0.9.1_0 (active)
  dbus @1.2.1_0 (active)
  dd_rescue @1.14_0 (active)
  ddrescue @1.8_1 (active)
  di @4.12_0 (active)
  disktype @9_0 (active)
  expat @2.0.1_0 (active)
  faac @1.26_0 (active)
  faad2 @2.6.1_0 (active)
  fdupes @1.40_0 (active)
  ffmpeg @0.4.9-pre1_8+a52+darwin_i386+faac+faad+gpl+lame+theora+x264+xvid (active)
  fontconfig @2.5.0_0+macosx
  fontconfig @2.6.0_0+macosx (active)
  freetype @2.3.5_1
  freetype @2.3.6_0 (active)
  fribidi @0.10.9_0 (active)
  gawk @3.1.6_0 (active)
  gd2 @2.0.35_1 (active)
  gdbm @1.8.3_1 (active)
  gettext @0.17_3 (active)
  ghostscript @8.62_1 (active)
  glib1 @1.2.10_5 (active)
  glib2 @2.16.3_0+darwin_9 (active)
  gmake @3.81_0 (active)
  gperf @3.0.3_0 (active)
  gtk2 @2.12.9_0+no_x11+quartz (active)
  help2man @1.36.4_1 (active)
  ImageMagick @6.4.2-1_1+jpeg2+mpeg+q16
  isightcapture @1.1_0+universal (active)
  jasper @1.900.1_1+darwin_9 (active)
  jpeg @6b_2 (active)
  lame @3.97_0 (active)
  lcms @1.17_0 (active)
  libart_lgpl @2.3.20_0 (active)
  libdts @0.0.2_0 (active)
  libdv @1.0.0_0+darwin_i386 (active)
  libiconv @1.12_0 (active)
  libmad @0.15.1b_1 (active)
  libmng @1.0.10_0 (active)
  libogg @1.1.3_2 (active)
  libpaper @1.1.21_1 (active)
  libpcap @0.9.8_0 (active)
  libpixman @0.10.0_0 (active)
  libpng @1.2.29_0 (active)
  libsdl @1.2.13_2 (active)
  libtheora @1.0beta2_0+darwin_9_i386 (active)
  libtool @1.5.26_0 (active)
  libungif @4.1.4_2 (active)
  libvorbis @1.2.0_1 (active)
  libxml2 @2.6.31_0
  libxml2 @2.6.32_0 (active)
  links @2.1pre28_0
  links @2.1pre36_0 (active)
  lzo2 @2.02_2+darwin_9 (active)
  m4 @1.4.11_0 (active)
  macfuse @1.5_0 (active)
  mc @4.6.1_0 (active)
  mdf2iso @0.3.0_0 (active)
  mpeg2vidcodec @1.2_0+x11 (active)
  mpeg4ip @1.5.0.1_0 (active)
  MPlayer @1.0rc2_2+binary_codecs+dts+dv+faac+fribidi+macosx+noappleremote+osd+speex+theora+x264+xvid (active)
  mtr @0.72_0 (active)
  nail @11.25_0 (active)
  ncurses @5.6_0 (active)
  ncursesw @5.6_1 (active)
  nmap @4.60_0 (active)
  ntop @3.3_1 (active)
  openssh @5.0p1_0+darwin_9 (active)
  openssl @0.9.8g_0
  openssl @0.9.8h_0 (active)
  p5-locale-gettext @1.05_0 (active)
  p5-xml-parser @2.36_0 (active)
  pango @1.20.2_0 (active)
  pcre @7.7_0 (active)
  perl5.8 @5.8.8_2+darwin_9 (active)
  pkgconfig @0.23_0 (active)
  popt @1.13_0 (active)
  procfs @2.0_0 (active)
  python25 @2.5.2_5+darwin_9 (active)
  qt4-mac @4.4.0_2+dbus+demos+docs+examples (active)
  qtplay @1.3.1_0 (active)
  render @0.9_1 (active)
  rrdtool @1.2.27_1 (active)
  shared-mime-info @0.23_2
  shared-mime-info @0.40_0 (active)
  socket @1.4_0 (active)
  speex-devel @1.2beta1_0 (active)
  sshfs @1.9_0 (active)
  tcl @8.5.2_0 (active)
  testdisk @6.6_0 (active)
  tiff @3.8.2_1+darwin_9+macosx
  tiff @3.8.2_2+darwin_9+macosx (active)
  unrar @3.7.8_0 (active)
  urw-fonts @1.0.7pre44_0 (active)
  wget @1.11.2_0
  wget @1.11.3_1 (active)
  wireshark @1.0.0_0+darwin_9 (active)
  x264 @20080108_0 (active)
  xorg-util-macros @1.1.5_0 (active)
  xorg-xproto @7.0.11_1 (active)
  XviD @1.1.3_1 (active)
  zlib @1.2.3_1 (active)

bash-3.2# port install mjpegtools +gtk +libdv +sdl
--->  Fetching gtk1
--->  Verifying checksum(s) for gtk1
--->  Extracting gtk1
--->  Applying patches to gtk1
--->  Configuring gtk1
Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_x11_gtk1/work/gtk+-1.2.10" && ./configure --prefix=/opt/local --disable-shm --with-locale --mandir=/opt/local/share/man --infodir=/opt/local/share/info " returned error 1
Command output: checking for putenv... yes
checking for setenv... yes
checking for setlocale... yes
checking for strchr... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for __argz_count... no
checking for __argz_stringify... no
checking for __argz_next... no
checking for stpcpy... yes
checking for LC_MESSAGES... yes
checking whether NLS is requested... yes
checking for libintl.h... yes
checking for dgettext in libc... no
checking for bindtextdomain in -lintl... yes
checking for dgettext in libintl... checking for dgettext in -lintl... yes
yes
checking for msgfmt... /opt/local/bin/msgfmt
checking for dcgettext... yes
checking for gmsgfmt... /opt/local/bin/msgfmt
checking for xgettext... /opt/local/bin/xgettext
checking for catalogs to be installed...  az ca cs da de el es et eu fi fr ga gl hr hu it ja ko lt nl no nn pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_CN.GB2312 zh_TW.Big5
checking for extra flags to get ANSI library prototypes... none needed
checking for extra flags for POSIX compliance... none needed
checking for glib-config... /opt/local/bin/glib-config
checking for GLIB - version >= 1.2.8... yes
checking for X... no
configure: error: 
*** X libraries or include files not found. Check 'config.log' for 
*** more details.

Error: The following dependencies failed to build: gtk1
Error: Status 1 encountered during processing.

comment:7 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Milestone: Port EnhancementsPort Bugs

Thanks mroman.

  1. Looks like you have graphviz installed in /usr/local. Any reason why the MacPorts graphviz port was insufficient? If so, please let me know by email or in a new ticket so I can make it sufficient.

The problem with having things in /usr/local is that software installed using MacPorts might look for libraries in /usr/local before looking in /opt/local, and this will cause problems. We don't know how to tell software not to do that, so the only thing we can do is tell people not to put anything in /usr/local. In this particular case I don't think this is a problem. I thought maybe you had some more generic libraries in /usr/local which would have been more problematic.

  1. Ok, so libdv.dylib is provided by libdv. And mjpegtools already has a libdv variant, and an sdl variant. So the port just needs to be enhanced to not link against those libraries when those variants are not chosen.

3, 4: So gtk1 doesn't find your X libraries either. I cannot reproduce that either; gtk1 installs without error for me on Tiger and Leopard on Intel on the systems I mentioned above. Check the config.log for more details, like it says, or attach it here and I'll have a look at it.

P.S: In the future, please remember WikiFormatting.

comment:8 Changed 16 years ago by mroman@…

Sorry for waiting so long. I've reinstalled os and everything seems compiling well. I suppose this problem was occured becouse I had not installed X11 from leopard dvd, but XQuartz.

Sorry for troubles.

comment:9 Changed 16 years ago by mf2k (Frank Schima)

Resolution: invalid
Status: newclosed

Actually XQuartz works fine with MacPorts. I highly recommend it.

Glad you solved the problem!

comment:10 in reply to:  7 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

  1. Ok, so libdv.dylib is provided by libdv. And mjpegtools already has a libdv variant, and an sdl variant. So the port just needs to be enhanced to not link against those libraries when those variants are not chosen.

Filed as #16606.

comment:11 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Port: mjpegtools added

comment:12 Changed 16 years ago by detto-brumm@…

I had the exact same problem on my fresh 10.5.4 installation upgraded to 10.5.5 , installed xquartz-2.3.1 , installed Xcode3 (latest version) , and macports-1.6.0.

The diff change in Portfile did work.

Would be nice to see it fixed tho.

comment:13 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.