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

"cmake .." encounter error #23

Closed
luckypoem opened this issue Jan 26, 2018 · 8 comments
Closed

"cmake .." encounter error #23

luckypoem opened this issue Jan 26, 2018 · 8 comments

Comments

@luckypoem
Copy link

luckypoem commented Jan 26, 2018

git clone https://github.com/trojan-gfw/trojan
cd trojan/
git checkout stable
mkdir build
cd build/
cmake ..

after running "cmake .." ,i encounter error as follows:
...
CMake Error at /usr/local/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR: Found unsuitable version "1.0.1t", but
required is at least "1.0.2" (found /usr/lib/x86_64-linux-gnu/libcrypto.so)
Call Stack (most recent call first):
/usr/local/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.10/Modules/FindOpenSSL.cmake:379 (find_package_handle_standard_args)
CMakeLists.txt:12 (find_package)
-- Configuring incomplete, errors occurred!
See also "/root/trojan/build/CMakeFiles/CMakeOutput.log".
See also "/root/trojan/build/CMakeFiles/CMakeError.log".
root@yms:~/trojan/build#

i already uprade openssl to version1.0.2:
root@yms:# which openssl
/usr/local/ssl/bin/openssl
root@yms:
# openssl version
OpenSSL 1.0.2n 7 Dec 2017

how to fix it?
thank you

@antonchen
Copy link

You need to specify the OpenSSL include directory

// Path to a file.
OPENSSL_INCLUDE_DIR:PATH=OPENSSL_INCLUDE_DIR-NOTFOUND

@luckypoem
Copy link
Author

@antonchen
不太明白。怎么指定OpenSSL include 目录?在哪里指定?
能把具体命令写出来吗

@GreaterFire
Copy link
Member

GreaterFire commented Jan 26, 2018

cmake .. -DOPENSSL_ROOT_DIR=/usr/local/ssl/

Make sure to clean up the build directory before you rerun cmake.

@luckypoem
Copy link
Author

@GreaterFire
this time "cmake .." encounter no error,but then "make" encounter error:
root@yms:/trojan/build# ls
CMakeCache.txt cmake_install.cmake Makefile trojan.service
CMakeFiles CTestTestfile.cmake trojan.json
root@yms:
/trojan/build# make
...
collect2: error: ld returned 1 exit status
CMakeFiles/trojan.dir/build.make:335: recipe for target 'trojan' failed
make[2]: *** [trojan] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/trojan.dir/all' failed
make[1]: *** [CMakeFiles/trojan.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
root@yms:~/trojan/build#

how to fix it?
tks

@GreaterFire
Copy link
Member

GreaterFire commented Jan 26, 2018

Please provide full compilation log.

P.S. Try to delete all the files in the build directory by rm -rf * and then cmake & make again.

@luckypoem
Copy link
Author

@GreaterFire
"delete all the files in the build directory by rm -rf * and then cmake & make again", the same result.
very strange.
i update openssl as per this article- https://sb.sb/centos-upgrade-openssl/ ,
isn't the method of updating openssl correct?

@luckypoem
Copy link
Author

@GreaterFire

and can u pls also provide binary file on linux vps of https://github.com/trojan-gfw/trojan/releases/tag/v0.6.0?

@luckypoem
Copy link
Author

@GreaterFire
我换了一台vps,它里面的openssl的版本已经是1.0.2,这样就能顺利make了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants