microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.89k stars 1.63k forks source link

../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found #1786

Open QGB opened 6 months ago

QGB commented 6 months ago
root@f92f2e6a26ce:/home/qgb/github/example-pybind11-vcpkg# vcpkg install cpprestsdk pybind11                                                                      
Computing installation plan...          
The following packages are already installed:                                    
    cpprestsdk[core,compression]:x64-linux@2.10.19                               
    pybind11:x64-linux@2.11.1           
cpprestsdk:x64-linux is already installed                                        
pybind11:x64-linux is already installed 
Total install time: 48.5 us             
cpprestsdk provides CMake targets:      

  # this is heuristically generated, and may not be correct                      
  find_package(cpprestsdk CONFIG REQUIRED)                                       
  target_link_libraries(main PRIVATE cpprestsdk::cpprest cpprestsdk::cpprestsdk_zlib_internal cpprestsdk::cpprestsdk_boost_internal cpprestsdk::cpprestsdk_openssl_internal)                              

pybind11 provides CMake targets. There are two modes provided; classic, which is built on the old Python                                                          
discovery packages in CMake, or the new FindPython mode, which uses FindPython   
from 3.12+ forward (3.15+ _highly_ recommended).     

https://github.com/QGB/example-pybind11-vcpkg/blob/master/cashflow.cpp#L42

QGB commented 6 months ago

build command : https://github.com/QGB/example-pybind11-vcpkg/blob/master/README.org

/home/qgb/anaconda3/bin/python client1.py
Traceback (most recent call last):
  File "/home/qgb/github/example-pybind11-vcpkg/client1.py", line 2, in <module>
    from cashflow import CashFlow
ImportError: /home/qgb/anaconda3/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/qgb/github/example-pybind11-vcpkg/cashflow.cpython-311-x86_64-linux-gnu.so)

remove restcpp code is OK

QGB commented 6 months ago

不能保留头文件

#include <cpprest/http_client.h>  
#include <cpprest/json.h>

/home/qgb/anaconda3/bin/python client1.py                                        
Traceback (most recent call last):      
  File "/home/qgb/github/example-pybind11-vcpkg/client1.py", line 2, in <module> 
    from cashflow import CashFlow       
ImportError: /home/qgb/github/example-pybind11-vcpkg/cashflow.cpython-311-x86_64-linux-gnu.so: undefined symbol: ERR_lib_error_string                             
make: *** [Makefile:17: run] Error 1