Closed hooklab closed 5 years ago
你用的什么编译器?
报错信息显示缺少 libstdc++
报错信息显示缺少 libstdc++
cmake -P package.cmake
[ying@ying WizNotePlus]$ cmake --version cmake version 3.12.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
报错信息显示缺少 libstdc++
cmake -P package.cmake
[ying@ying WizNotePlus]$ cmake --version cmake version 3.12.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
[ying@ying apollo]$ locate libstdc++.so /opt/EdrawMax-8.7/lib/libstdc++.so.6.0.21 /opt/EdrawMax-8.7/lib/libstdc++.so.6.bak /usr/lib/libstdc++.so /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6.0.25 /usr/lib/debug/usr/lib/gcc/x86_64-redhat-linux/5.3.1/libstdc++.so.debug /usr/lib/debug/usr/lib64/libstdc++.so.6.0.21.debug /usr/lib/debug/usr/lib64/libstdc++.so.6.debug /usr/lib/debug/usr/lib64/libstdc++.so.debug /usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so /usr/lib/gcc/x86_64-redhat-linux/8/32/libstdc++.so /usr/lib64/libstdc++.so /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.0.25
你把执行 cmake -P package.cmake
的输出日志全部贴出来,我需要看看 cmake configure 过程的信息。
你把执行
cmake -P package.cmake
的输出日志全部贴出来,我需要看看 cmake configure 过程的信息。
[ying@ying WizNotePlus]$ cmake -P package.cmake
The following variables must be confirmed:
-- Using CMAKE_PREFIX_PATH: /pros/programs/qt/5.11.2/gcc_64 -- Using WIZNOTE_SOURCE_DIR: /pros/programs/WizNotePlus -- Using WIZNOTE_BUILD_DIR: /pros/programs/build-WizNotePlus -- Using WIZNOTE_PACKAGE_DIR: /pros/programs/package-WizNotePlus -- Using WIZNOTE_INSTALL_PREFIX: /pros/programs/package-WizNotePlus/WizNote -- GENERATE_INSTALL_DIR: ON -- GENERATE_APPIMAGE: ON -- USE_FCITX: ON
Start configure and generate WizNotePlus project:
Start generate 3rdparty dependencies at /pros/programs/build-WizNotePlus:
-- Current conanbuildinfo.cmake directory: /pros/programs/build-WizNotePlus -- Conan: Compiler GCC>=5, checking major version 8 -- Conan: Checking correct version: 8 -- Conan: Using cmake global configuration -- Conan: Adjusting default RPATHs Conan policies -- Conan: Adjusting language standard -- /pros/programs/WizNotePlus/resources/wiznote.qrc WizNote whill compiling as Release, use Qt: -- Configuring done -- Generating done -- Build files have been written to: /pros/programs/build-WizNotePlus
Start build WizNotePlus project:
[ 15%] Built target quazip_static [ 29%] Built target quazip5 [ 33%] Built target Gumbo_static [ 36%] Built target Gumbo [ 38%] Built target gumbo_query_static [ 41%] Built target gumbo_query_shared [ 41%] Automatic MOC for target WizNote [ 41%] Built target WizNote_autogen [ 42%] Linking CXX executable ../bin/WizNote /usr/bin/ld: 找不到 -lstdc++ collect2: 错误:ld 返回 1 gmake[2]: [src/CMakeFiles/WizNote.dir/build.make:2629:bin/WizNote] 错误 1 gmake[1]: [CMakeFiles/Makefile2:439:src/CMakeFiles/WizNote.dir/all] 错误 2 gmake: *** [Makefile:130:all] 错误 2 CMake Error at package.cmake:197 (message): Fail to build WizNotePlus project!
试试 sudo yum install libstdc++-static
另外,你的执行 cmake 命令的 shell 的环境变量 PATH 包含了 libstdc++.so 所在位置吗?
另外,你的执行 cmake 命令的 shell 的环境变量 PATH 包含了 libstdc++.so 所在位置吗? 你说的,可以了,sudo yum install libstdc++-static , 不过有新的问题
[ying@ying WizNotePlus]$ cmake -P package.cmake
The following variables must be confirmed:
-- Using CMAKE_PREFIX_PATH: /pros/programs/qt/5.11.2/gcc_64 -- Using WIZNOTE_SOURCE_DIR: /pros/programs/WizNotePlus -- Using WIZNOTE_BUILD_DIR: /pros/programs/build-WizNotePlus -- Using WIZNOTE_PACKAGE_DIR: /pros/programs/package-WizNotePlus -- Using WIZNOTE_INSTALL_PREFIX: /pros/programs/package-WizNotePlus/WizNote -- GENERATE_INSTALL_DIR: ON -- GENERATE_APPIMAGE: ON -- USE_FCITX: ON
Start configure and generate WizNotePlus project:
Start generate 3rdparty dependencies at /pros/programs/build-WizNotePlus:
-- Current conanbuildinfo.cmake directory: /pros/programs/build-WizNotePlus -- Conan: Compiler GCC>=5, checking major version 8 -- Conan: Checking correct version: 8 -- Conan: Using cmake global configuration -- Conan: Adjusting default RPATHs Conan policies -- Conan: Adjusting language standard -- /pros/programs/WizNotePlus/resources/wiznote.qrc WizNote whill compiling as Release, use Qt: -- Configuring done -- Generating done -- Build files have been written to: /pros/programs/build-WizNotePlus
Start build WizNotePlus project:
[ 15%] Built target quazip_static
[ 29%] Built target quazip5
[ 33%] Built target Gumbo_static
[ 36%] Built target Gumbo
[ 38%] Built target gumbo_query_static
[ 41%] Built target gumbo_query_shared
[ 41%] Automatic MOC for target WizNote
[ 41%] Built target WizNote_autogen
[ 42%] Linking CXX executable ../bin/WizNote
/usr/bin/ld: CMakeFiles/WizNote.dir/share/WizEnc.cpp.o:(.data.rel.ro._ZTVN8CryptoPP20AutoSeededRandomPoolE[_ZTVN8CryptoPP20AutoSeededRandomPoolE]+0x60): undefined reference to `CryptoPP::RandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits
另外,你的执行 cmake 命令的 shell 的环境变量 PATH 包含了 libstdc++.so 所在位置吗?
看来就是 没有安装 static 的, 只是安装了 so 的
执行一下几个命令,把输出贴出来看看:
gcc --version
cat ~/.conan/profiles/default
conan get cryptopp/5.6.5@bincrafters/stable
执行一下几个命令,把输出贴出来看看:
gcc --version cat ~/.conan/profiles/default conan get cryptopp/5.6.5@bincrafters/stable
[ying@ying WizNotePlus]$ gcc --version
gcc (GCC) 8.2.1 20181105 (Red Hat 8.2.1-5)
Copyright © 2018 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。
[ying@ying WizNotePlus]$ cat ~/.conan/profiles/default
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
[ying@ying WizNotePlus]$ conan get cryptopp/5.6.5@bincrafters/stable
from conans import ConanFile, CMake
from conans import tools
import os
class CryptoPPConan(ConanFile):
name = "cryptopp"
version = "5.6.5"
url = "https://github.com/bincrafters/conan-cryptopp"
description = "Crypto++ Library is a free C++ class library of cryptographic schemes."
generators = "cmake"
settings = "os", "compiler", "build_type", "arch"
license = "https://github.com/weidai11/cryptopp/blob/master/License.txt"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {'shared': False, 'fPIC': True}
exports_sources = ["CMakeLists.txt", "a0f91aeb2587.patch"]
_source_subfolder = "sources"
def configure(self):
if self.settings.os == "Windows":
self.options.remove("fPIC")
def source(self):
zipname = 'CRYPTOPP_5_6_5.tar.gz'
tools.get('https://github.com/weidai11/cryptopp/archive/%s' % zipname)
os.rename("cryptopp-CRYPTOPP_5_6_5", self._source_subfolder)
tools.patch(patch_file="a0f91aeb2587.patch", base_path=self._source_subfolder)
def build(self):
cmake = CMake(self)
if self.settings.os == "Windows":
cmake.definitions["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = self.options.shared
cmake.definitions["BUILD_STATIC"] = not self.options.shared
cmake.definitions["BUILD_SHARED"] = self.options.shared
cmake.definitions["BUILD_TESTING"] = False
cmake.definitions["BUILD_DOCUMENTATION"] = False
cmake.configure()
cmake.build()
def package(self):
self.copy(pattern="License*", dst="licenses", src=self._source_subfolder, ignore_case=True, keep_path=False)
self.copy(pattern="*.h", dst="include/cryptopp", src=".", keep_path=False)
self.copy(pattern="*.so*", dst="lib", src=".", keep_path=False, symlinks=True)
self.copy(pattern="*.dll", dst="bin", src=".", keep_path=False)
if self.settings.build_type == "Debug":
self.copy(pattern="*.pdb", dst="bin", src=".", keep_path=False)
self.copy(pattern="*.dylib*", dst="lib", src=".", keep_path=False, symlinks=True)
self.copy(pattern="*.a", dst="lib", src=".", keep_path=False)
self.copy(pattern="*.lib", dst="lib", src=".", keep_path=False)
def package_info(self):
if str(self.settings.compiler) != "Visual Studio":
self.cpp_info.libs = ["cryptopp"]
else:
if self.options.shared:
self.cpp_info.libs = ["cryptopp-shared"]
else:
self.cpp_info.libs = ["cryptopp-static"]
你试试:
git fetch
git checkout develop
cmake -P package.cmake
你试试:
git fetch git checkout develop cmake -P package.cmake
牛逼,已经编译成功,运行起来了,怒赞!! 有紧急修复?
你试试:
git fetch git checkout develop cmake -P package.cmake
牛逼,已经编译成功,运行起来了,怒赞!! 有紧急修复?
忘了修复了啥,挺多内容的,可能是依赖问题。
[ 99%] Building CXX object src/CMakeFiles/WizNote.dir/qrc_wiznote.cpp.o [ 99%] Building CXX object src/CMakeFiles/WizNote.dir/WizNote_autogen/mocs_compilation.cpp.o [100%] Linking CXX executable ../bin/WizNote /usr/bin/ld: 找不到 -lstdc++ collect2: 错误:ld 返回 1 gmake[2]: [src/CMakeFiles/WizNote.dir/build.make:2629:bin/WizNote] 错误 1 gmake[1]: [CMakeFiles/Makefile2:439:src/CMakeFiles/WizNote.dir/all] 错误 2 gmake: *** [Makefile:130:all] 错误 2 CMake Error at package.cmake:197 (message): Fail to build WizNotePlus project!