Problem in Linking program

Irvanda Kurniadi irvanda.k at
Wed Mar 12 07:02:27 CET 2014


I'm trying to build my program in L4/Fiasco. This program requires libtiff,
MPI, and libstep library. I've ported those all libraries. But, when I
built my program, I got a problem in linking program. The compilation just
work fine but when entering the linking part, I got this error message:

==> Linking sobel-step
main-sobel-V4.cpp_processed.o: In function `main':
undefined reference to `__assert_fail'
undefined reference to `__assert_fail'

This "__assert_fail" should be available in and I've put the
LDFLAGS = -lstep on my makefile. Here is my Makefiel anyway:

PKGDIR          ?= ../..
L4DIR           ?= $(PKGDIR)/../..
SYSTEMS          =  x86-l4f amd64-l4f
include $(L4DIR)/mk/Makeconf

ifneq ($(SYSTEM),)
  # check whether used gcc has the omp.h file available
  OMP_H_PATH := $(shell $(CC) -print-file-name=include/omp.h)

  ifeq ($(strip $(OMP_H_PATH)),include/omp.h)
    $(info  $(CC) does not have omp.h header file available,
    TARGET        = $(if $(filter 4.2 4.3 4.4 4.5 4.6
    REQUIRES_LIBS = libgomp libtiff libmpich libmpich_f77sup libstep libc

SRC_C   = main-sobel-V4.cpp_processed.c sobel-omp-V4.cpp_processed.c
pictureInterface.c util.c
CFLAGS  += -fopenmp -I. -g -Wall
LDFLAGS += -rpath -ltiff -rpath -lstep


vpath %.c $(SRC_DIR)

include $(L4DIR)/mk/

Previously I compiled the program and there are so much missing shared
libraries and the debug message suggested to add the -rpath. I updated my
LDFLAGS by adding the -rpath. Here is the error message before I add the
LDFLAGS with -rpath:

 ==> Linking sobel-step
ld: warning:, needed by
/home/l4re-mpich/obj/l4/x86/lib/x86_586/l4f/, not found (try
using -rpath or -rpath-link)
ld: warning:, needed by
/home/l4re-mpich/obj/l4/x86/lib/x86_586/l4f/, not found (try
using -rpath or -rpath-link)
ld: final link failed: Bad value

I'm not sure whether this is causing another problem by adding the -rpath.
I mean, Is it the proper way to fix the missing shared library? Because the
"__asser_fail" is supposed to be found in the but I still got
the undefined reference error message. So perhaps there are several things
to wrap up this linking problem. If you by any chance find any misplace or
missing configuration in my makefile or you have any idea how to fix it
please let me know. Thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the l4-hackers mailing list