Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling in THIRDPARTY_STATIC_BUILD mode fails to link #35

Open
liudf0716 opened this issue Feb 4, 2023 · 2 comments
Open

Compiling in THIRDPARTY_STATIC_BUILD mode fails to link #35

liudf0716 opened this issue Feb 4, 2023 · 2 comments
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@liudf0716
Copy link
Owner

It's the compiling step:

  1. fork project and compile
git clone https://github.com/${YOUR_GITHUB_ACCOUNT_NAME}/xfrpc.git
cd xfrp
mkdir build
cmake -D THIRDPARTY_STATIC_BUILD=ON ..
make
  1. at the link stage, the error 'undefined reference to `arc4random' is encountered
[  5%] Building C object CMakeFiles/xfrpc.dir/main.c.o
[ 10%] Building C object CMakeFiles/xfrpc.dir/client.c.o
[ 15%] Building C object CMakeFiles/xfrpc.dir/config.c.o
[ 20%] Building C object CMakeFiles/xfrpc.dir/control.c.o
[ 25%] Building C object CMakeFiles/xfrpc.dir/ini.c.o
[ 30%] Building C object CMakeFiles/xfrpc.dir/msg.c.o
[ 35%] Building C object CMakeFiles/xfrpc.dir/xfrpc.c.o
[ 40%] Building C object CMakeFiles/xfrpc.dir/debug.c.o
[ 45%] Building C object CMakeFiles/xfrpc.dir/zip.c.o
[ 50%] Building C object CMakeFiles/xfrpc.dir/commandline.c.o
[ 55%] Building C object CMakeFiles/xfrpc.dir/crypto.c.o
[ 60%] Building C object CMakeFiles/xfrpc.dir/fastpbkdf2.c.o
[ 65%] Building C object CMakeFiles/xfrpc.dir/utils.c.o
[ 70%] Building C object CMakeFiles/xfrpc.dir/common.c.o
[ 75%] Building C object CMakeFiles/xfrpc.dir/login.c.o
[ 80%] Building C object CMakeFiles/xfrpc.dir/proxy_tcp.c.o
[ 85%] Building C object CMakeFiles/xfrpc.dir/proxy_ftp.c.o
[ 90%] Building C object CMakeFiles/xfrpc.dir/proxy.c.o
[ 95%] Building C object CMakeFiles/xfrpc.dir/tcpmux.c.o
[100%] Linking C executable xfrpc
/usr/bin/ld: /workspaces/codespaces-blank/xfrpc/thirdparty/libs/libjson-c.a(random_seed.c.o): in function `json_c_get_random_seed':
/workspaces/codespaces-blank/xfrpc/thirdparty/json-c/random_seed.c:331: undefined reference to `arc4random'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/xfrpc.dir/build.make:354: xfrpc] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/xfrpc.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
@liudf0716 liudf0716 added the bug Something isn't working label Feb 4, 2023
@helintongh
Copy link
Collaborator

helintongh commented Feb 4, 2023

I know the cause of the error, and will fix this bug in the compilation of adding mips architecture.

@liudf0716 liudf0716 added the invalid This doesn't seem right label Feb 4, 2023
@helintongh
Copy link
Collaborator

Replacing the json.h in the include with the generated json.h should fix the issue.
pr is #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants