Fix: UDF version `GLIBCXX_3.4.21' not found (#2629)
This commit is contained in:
@ -22,4 +22,12 @@ set(LIBRARY_OUTPUT_PATH "${BUILD_DIR}/src/udf_samples")
|
||||
set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/src/udf_samples")
|
||||
|
||||
add_library(udfsample SHARED udf_sample.cpp)
|
||||
target_link_libraries(udfsample
|
||||
-static-libstdc++
|
||||
-static-libgcc
|
||||
)
|
||||
add_library(udasample SHARED uda_sample.cpp)
|
||||
target_link_libraries(udasample
|
||||
-static-libstdc++
|
||||
-static-libgcc
|
||||
)
|
||||
|
||||
@ -75,7 +75,7 @@ under the License.
|
||||
|
||||
### 编写CMakeLists.txt
|
||||
|
||||
基于上一步生成的`headers|libs`,用户可以使用`CMakeLists`等工具引入该依赖;在`CMakeLists`中,可以通过向`CMAKE_CXX_FLAGS`添加`-I|L`分别指定`headers|libs`路径;然后使用`add_library`添加动态库。例如,在`be/src/udf_samples/CMakeLists.txt`中,使用`add_library(udfsample SHARED udf_sample.cpp)`增加了一个`udfsample`动态库。后面需要写上涉及的所有源文件(不包含头文件)。
|
||||
基于上一步生成的`headers|libs`,用户可以使用`CMakeLists`等工具引入该依赖;在`CMakeLists`中,可以通过向`CMAKE_CXX_FLAGS`添加`-I|L`分别指定`headers|libs`路径;然后使用`add_library`添加动态库。例如,在`be/src/udf_samples/CMakeLists.txt`中,使用`add_library(udfsample SHARED udf_sample.cpp)` `target_link_libraries`(udfsample -static-libstdc++ -static-libgcc)增加了一个`udfsample`动态库。后面需要写上涉及的所有源文件(不包含头文件)。
|
||||
|
||||
### 执行编译
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ Executing `sh build.sh` in the Doris root directory generates the corresponding
|
||||
|
||||
### Edit CMakeLists.txt
|
||||
|
||||
Based on the `headers | libs` generated in the previous step, users can introduce the dependency using tools such as `CMakeLists`; in `CMakeLists`, dynamic libraries can be added by adding `-I|L` to `CMAKE_CXX_FLAGS`, respectively. For example, in `be/src/udf_samples/CMakeLists.txt`, a `udf sample` dynamic library is added using `add_library` (udfsample SHARED udf_sample.cpp). You need to write down all the source files involved later (no header files included).
|
||||
Based on the `headers | libs` generated in the previous step, users can introduce the dependency using tools such as `CMakeLists`; in `CMakeLists`, dynamic libraries can be added by adding `-I|L` to `CMAKE_CXX_FLAGS`, respectively. For example, in `be/src/udf_samples/CMakeLists.txt`, a `udf sample` dynamic library is added using `add_library` (udfsample SHARED udf_sample.cpp) `target_link_libraries`(udfsample -static-libstdc++ -static-libgcc). You need to write down all the source files involved later (no header files included).
|
||||
|
||||
### Execute compilation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user