[dev] Re: [slstatus] FreeBSD compiling problem ld undefined symbol
On 19/07/30 09:22AM, Jason Smith wrote:
I added -lkvm to LDFLAGS and everything compile without any problem.
Thanks to Micheal Buch.
> Here is what I get when I tried make:
>
> cc -o slstatus -L/usr/local/lib -s components/battery.o components/cpu.o components/datetime.o components/disk.o components/entropy.o components/hostname.o components/ip.o components/kernel_release.o components/keyboard_indicators.o components/keymap.o components/load_avg.o components/netspeeds.o components/num_files.o components/ram.o components/run_command.o
> components/swap.o components/temperature.o components/uptime.o components/user.o components/volume.o components/wifi.o util.o slstatus.o -lX11
> /usr/bin/ld: error: undefined symbol: kvm_openfiles
> >>> referenced by swap.c
> >>> components/swap.o:(getswapinfo)
>
> /usr/bin/ld: error: undefined symbol: kvm_getswapinfo
> >>> referenced by swap.c
> >>> components/swap.o:(getswapinfo)
>
> /usr/bin/ld: error: undefined symbol: kvm_close
> >>> referenced by swap.c
> >>> components/swap.o:(getswapinfo)
>
> /usr/bin/ld: error: undefined symbol: kvm_close
> >>> referenced by swap.c
> >>> components/swap.o:(getswapinfo)
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> *** Error code 1
>
> Stop.
> make: stopped in /usr/local/src/slstatus
>
> Here is my config.mk:
> # slstatus version
> VERSION = 0
>
> # customize below to fit your system
>
> # paths
> PREFIX = /usr/local
> MANPREFIX = $(PREFIX)/share/man
>
> X11INC = /usr/local/include
> X11LIB = /usr/local/lib
>
> # flags
> CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE
> CFLAGS = -std=c99 -pedantic -Wall -Wextra -Os
> LDFLAGS = -L$(X11LIB) -s
> LDLIBS = -lX11
>
> # compiler and linker
> CC = cc
>
> What is the problem with swap.c and swap.o ?
Received on Tue Jul 30 2019 - 11:59:01 CEST
This archive was generated by hypermail 2.3.0
: Tue Jul 30 2019 - 15:12:10 CEST