G.ONE
G.ONE

Reputation: 537

error during cross-compilation of openvpn for arm-cortex uclinux

I am trying to cross compile openvpn using arm-uclinuxeabi toolchain getting error

init.o: In function `do_persist_tuntap':
init.c:(.text+0x1534): undefined reference to `tuncfg'

error in following part of init.c

#ifdef ENABLE_FEATURE_TUN_PERSIST
      tuncfg (options->dev, options->dev_type, options->dev_node,
          options->persist_mode,
          options->username, options->groupname, &options->tuntap_options);

what is the solution for it ?

I found that tuncfg is defined in tun.c file in the same folder in which init.c is present

Upvotes: 1

Views: 379

Answers (1)

zhaolei0527
zhaolei0527

Reputation: 11

I met the same problem, and I have solved now. The reason might be the "tuncfg" function only enabled when the "TARGET_LINUX" macro is defined,you can find the statement "#if defined(TARGET_LINUX)" from tun.c. And TARGET_LINUX macro was generated when you excute configure shell,you can find the statements as follows from configure file:

case "$host" in
        *-*-linux*)

$as_echo "#define TARGET_LINUX 1" >>confdefs.h

so we should add the parameter --host when we excute confiure shell ,and the parameter should contains the string "linux",eg:

./configure --host=mips-linux

Upvotes: 1

Related Questions