You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have problem linking lorcon library with my code.
I have installed LORCON on openWRT using the source code from this Github. It works fine.
When I want to write a piece of code to making use lorcon, it has a problem linking lorcon.
My test code is quite simple,
First of all, I include the headers using
#include <lorcon.h>
#include <lorcon_packet.h>
Second, I called the "lorcon_list_drivers" and "lorcon_free_driver_list".
My Makefile is as follows:
CC = mips-openwrt-linux-musl-gcc
LDFLAGS = -L/home/alex/openwrt/trunk/openwrt/staging_dir/target-mips_34kc_musl-1.1.16/usr/lib/lorcon
CFLAGS = -I/home/alex/openwrt/trunk/openwrt/staging_dir/target-mips_34kc_musl-1.1.16/usr/include/lorcon2 -O3 -Wall -static -DHAVE_CONFIG_H
OBJS = injector_v1.o
injector_v1: injector_v1.c
$(CC) $(CFLAGS) injector_v1.c -o injector_v1 $(LDFLAGS)
all: injector_v1
When I compile, I got an error:
/tmp/cci1WCop.o: In function `usage':
injector_v1.c:(.text+0x20): undefined reference to `lorcon_list_drivers'
injector_v1.c:(.text+0x7c): undefined reference to `lorcon_free_driver_list'
What's the problem here?
I also tried $(CC) $(CFLAGS) injector_v1.c -o injector_v1 $(LDFLAGS) -lorcon2
and it says: openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.3.0/../../../../mips-openwrt-linux-musl/bin/ld: cannot find -lorcon2
Any help will be appreciated.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Hi there,
I have problem linking lorcon library with my code.
I have installed LORCON on openWRT using the source code from this Github. It works fine.
When I want to write a piece of code to making use lorcon, it has a problem linking lorcon.
My test code is quite simple,
First of all, I include the headers using
Second, I called the "lorcon_list_drivers" and "lorcon_free_driver_list".
My Makefile is as follows:
What's the problem here?
I also tried
$(CC) $(CFLAGS) injector_v1.c -o injector_v1 $(LDFLAGS) -lorcon2
and it says:
openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.3.0/../../../../mips-openwrt-linux-musl/bin/ld: cannot find -lorcon2
Any help will be appreciated.
Thanks in advance.
The text was updated successfully, but these errors were encountered: