linux qt 打包程序报错,/home/lxy/anaconda3/lib/libQt5Widgets.so:对‘std::pmr::monotonic_buffer_resource::~monotonic_buffer_resource()@GLIBCXX_3.4.28’未定义的引用 /home/lxy/anaconda3/lib/libQt5Core.so:对‘std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13’未定义的引用 /home/lxy/anaconda3/lib/libQt5Widgets.so:对‘vtable for std::pmr::monotonic_buffer_resource@GLIBCXX_3.4.28’未定义的引用 /home/lxy/anaconda3/lib/libQt5Widgets.so:对‘std::pmr::get_default_resource()@GLIBCXX_3.4.26’未定义的引用 /home/lxy/anaconda3/lib/libQt5Widgets.so:对‘std::__throw_bad_array_new_length()@GLIBCXX_3.4.29’未定义的引用 /home/lxy/anaconda3/lib/libQt5Core.so:对‘std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13’未定义的引用 collect2: error: ld returned 1 exit status
时间: 2023-07-10 08:40:13 浏览: 297
这个错误通常是由于链接器无法找到所需的库文件或库文件版本不兼容导致的。根据错误信息,似乎是缺少对 libstdc++.so.6 库的链接。你可以尝试添加以下参数来链接该库:
```
-L/usr/lib64 -lstdc++
```
如果你的系统是 32 位的,则将 -L/usr/lib64 替换为 -L/usr/lib。如果还是无法解决问题,你可以尝试更新 libstdc++ 库,或者重新编译 Qt 库。
相关问题
/home/kejia/Server/tf/Bin_x64/DeepLearning/DL_Lib_02/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 803: system has unsupported display driver / cuda driver combination (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0 gpu count 0 Traceback (most recent call last): File "DL_ProcessManager_01.py", line 5, in <module> File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "PyInstaller/loader/pyimod03_importers.py", line 540, in exec_module File "DL_ProcessManager/__init__.py", line 1, in <module> File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "PyInstaller/loader/pyimod03_importers.py", line 540, in exec_module File "DL_ProcessManager/DL_ProcessManager.py", line 12, in <module> File "/home/lxy/anaconda3/envs/mmdet2/lib/python3.7/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py", line 55, in _freeze_support File "multiprocessing/spawn.py", line 105, in spawn_main File "multiprocessing/spawn.py", line 115, in _main AttributeError: Can't get attribute 'CarmeraFunc' on <module '__main__' (built-in)> [15584] Failed to execute script DL_ProcessManager_01
这个错误是由于CUDA初始化时出现了问题,可能是由于不匹配的显示驱动程序和CUDA驱动程序导致的。下面是一些可能的解决方案:
1. 确保你的显示驱动程序与安装的CUDA版本兼容。你可以在NVIDIA官方网站上找到CUDA与驱动程序版本的兼容性信息。如果不兼容,请尝试更新或降低驱动程序版本,使其与CUDA版本匹配。
2. 确保你的CUDA环境正确配置。验证CUDA是否正确安装和配置,可以尝试运行一些简单的CUDA示例代码,以确保CUDA可以正常工作。
3. 检查你的代码中是否有其他与CUDA相关的操作在调用`torch.cuda.NumCudaDevices()`之前被执行。确保在调用此函数之前没有其他CUDA操作。
4. 确保你的环境变量设置正确。检查环境变量`LD_LIBRARY_PATH`是否包含正确的CUDA库路径。你可以使用以下命令检查:
```
echo $LD_LIBRARY_PATH
```
如果没有设置或设置不正确,你可以通过编辑`~/.bashrc`文件来设置正确的路径:
```
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
```
然后运行以下命令使更改生效:
```
source ~/.bashrc
```
5. 如果以上解决方案都无效,尝试重新安装CUDA和相关的驱动程序。
请注意,上述解决方案中的一些步骤可能需要管理员权限。如果你对系统没有足够的权限,建议与系统管理员合作或联系技术支持以获取进一步的帮助。同时,确保备份重要的数据,以防万一出现问题。
from jieba import posseg import requests from bs4 import BeautifulSoup import pandas as pd # 爬取教师信息 url = 'http://lxy.hzau.edu.cn/szll/jsml.htm' response = requests.get(url) response.encoding = 'utf-8' soup = BeautifulSoup(response.text, 'html.parser') teacher_nodes = soup.select('td a') teacher_info = [] for node in teacher_nodes: teacher_name = node.text.strip() teacher_link = 'http://lxy.hzau.edu.cn/' + node['href'] teacher_info.append((teacher_name, teacher_link)) # 整理数据并保存为CSV文件 df = pd.DataFrame({'teacher_name': [name for name, _ in teacher_info], 'teacher_link': [link for _, link in teacher_info]}) df.to_csv('Info.csv', encoding='utf-8-sig', index=False)请用R重构这段代码
以下是使用 R 重构的代码:
```R
library(rvest)
library(dplyr)
# 爬取教师信息
url <- 'http://lxy.hzau.edu.cn/szll/jsml.htm'
response <- read_html(url, encoding = 'utf-8')
teacher_nodes <- response %>%
html_nodes('td a')
teacher_info <- teacher_nodes %>%
purrr::map(function(node) {
teacher_name <- node %>% html_text(trim = TRUE)
teacher_link <- node %>% html_attr('href') %>% paste0('http://lxy.hzau.edu.cn/', .)
list(teacher_name = teacher_name, teacher_link = teacher_link)
})
# 整理数据并保存为CSV文件
df <- teacher_info %>%
purrr::map_df(~ as.list(.)) %>%
select(teacher_name, teacher_link)
write_csv(df, 'Info.csv', bom = TRUE)
```
使用 R 的 rvest 包来进行网页爬取和解析,使用 purrr 包来进行函数式编程,使用 dplyr 包来进行数据整理和处理,并使用 readr 包的 write_csv 函数来将数据保存为 CSV 文件。
阅读全文