I'm trying to compile a machine learning code written in c++ and connecting it to NodeJS using n-api, I have written the NAPI function in one of the files, and defined additional dependencies in CMake.
Installed
'node-addon-api': '^3.0.0'
'cmake-js':'^6.1.0'
error
> cmake-js compile
[
'/usr/bin/node',
'/home/nishant/Documents/demo/node_modules/.bin/cmake-js',
'compile'
]
info TOOL Using Unix Makefiles generator.
info CMD BUILD
info RUN cmake --build "/home/nishant/Documents/demo/build" --config Release
Consolidate compiler generated dependencies of target mobilenetknn
[ 60%] Built target mobilenetknn
Consolidate compiler generated dependencies of target program
[ 80%] Linking CXX executable program
CMakeFiles/program.dir/src/program.cpp.o: In function `Init(Napi::Env, Napi::Object)':
program.cpp:(.text+0x6b): undefined reference to `napi_create_function'
program.cpp:(.text+0xb8): undefined reference to `napi_create_symbol'
program.cpp:(.text+0xd3): undefined reference to `napi_create_external'
program.cpp:(.text+0x10f): undefined reference to `napi_define_properties'
program.cpp:(.text+0x133): undefined reference to `napi_create_string_utf8'
program.cpp:(.text+0x14a): undefined reference to `napi_set_property'
CMakeFiles/program.dir/src/program.cpp.o: In function `classAddTrainModel(Napi::CallbackInfo const&)':
program.cpp:(.text+0x268): undefined reference to `napi_coerce_to_number'
program.cpp:(.text+0x287): undefined reference to `napi_get_value_int32'
program.cpp:(.text+0x33a): undefined reference to `napi_get_element'
program.cpp:(.text+0x35d): undefined reference to `napi_get_element'
program.cpp:(.text+0x380): undefined reference to `napi_get_value_string_utf8'
program.cpp:(.text+0x3f7): undefined reference to `napi_get_value_string_utf8'
program.cpp:(.text+0x415): undefined reference to `napi_get_value_string_utf8'
program.cpp:(.text+0x48c): undefined reference to `napi_get_value_string_utf8'
program.cpp:(.text+0x8b8): undefined reference to `napi_create_double'
program.cpp:(.text+0xb55): undefined reference to `napi_get_undefined'
program.cpp:(.text+0xb7e): undefined reference to `napi_get_undefined'
program.cpp:(.text+0xbae): undefined reference to `napi_get_undefined'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::Error::~Error()':
program.cpp:(.text._ZN4Napi5ErrorD2Ev[_ZN4Napi5ErrorD5Ev]+0x46): undefined reference to `napi_delete_reference'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::AsyncContext::~AsyncContext()':
program.cpp:(.text._ZN4Napi12AsyncContextD2Ev[_ZN4Napi12AsyncContextD5Ev]+0x15): undefined reference to `napi_async_destroy'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::AsyncContext::~AsyncContext()':
program.cpp:(.text._ZN4Napi12AsyncContextD0Ev[_ZN4Napi12AsyncContextD5Ev]+0x19): undefined reference to `napi_async_destroy'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::Error::~Error()':
program.cpp:(.text._ZN4Napi5ErrorD0Ev[_ZN4Napi5ErrorD5Ev]+0x39): undefined reference to `napi_delete_reference'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::Error::Fatal(char const*, char const*)':
program.cpp:(.text._ZN4Napi5Error5FatalEPKcS2_[_ZN4Napi5Error5FatalEPKcS2_]+0x12): undefined reference to `napi_fatal_error'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::CallbackScope::~CallbackScope()':
program.cpp:(.text._ZN4Napi13CallbackScopeD2Ev[_ZN4Napi13CallbackScopeD5Ev]+0x14): undefined reference to `napi_close_callback_scope'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::CallbackScope::~CallbackScope()':
program.cpp:(.text._ZN4Napi13CallbackScopeD0Ev[_ZN4Napi13CallbackScopeD5Ev]+0x14): undefined reference to `napi_close_callback_scope'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::Error::New(napi_env__*)':
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0x30): undefined reference to `napi_get_last_error_info'
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0x45): undefined reference to `napi_is_exception_pending'
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0x84): undefined reference to `napi_create_string_utf8'
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0xbd): undefined reference to `napi_create_error'
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0x10b): undefined reference to `napi_create_reference'
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0x141): undefined reference to `napi_get_and_clear_last_exception'
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0x170): undefined reference to `napi_create_type_error'
program.cpp:(.text._ZN4Napi5Error3NewEP10napi_env__[_ZN4Napi5Error3NewEP10napi_env__]+0x1ef): undefined reference to `napi_delete_reference'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::HandleScope::~HandleScope()':
program.cpp:(.text._ZN4Napi11HandleScopeD2Ev[_ZN4Napi11HandleScopeD5Ev]+0xc): undefined reference to `napi_close_handle_scope'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::Error::ThrowAsJavaScriptException() const':
program.cpp:(.text._ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv[_ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv]+0x28): undefined reference to `napi_open_handle_scope'
program.cpp:(.text._ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv[_ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv]+0x43): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv[_ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv]+0x59): undefined reference to `napi_throw'
program.cpp:(.text._ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv[_ZNK4Napi5Error26ThrowAsJavaScriptExceptionEv]+0x6c): undefined reference to `napi_close_handle_scope'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::details::CallbackData<Napi::Number (*)(Napi::CallbackInfo const&), Napi::Number>::Wrapper(napi_env__*, napi_callback_info__*)':
program.cpp:(.text._ZN4Napi7details12CallbackDataIPFNS_6NumberERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__[_ZN4Napi7details12CallbackDataIPFNS_6NumberERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__]+0x65): undefined reference to `napi_get_cb_info'
program.cpp:(.text._ZN4Napi7details12CallbackDataIPFNS_6NumberERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__[_ZN4Napi7details12CallbackDataIPFNS_6NumberERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__]+0xb7): undefined reference to `napi_get_cb_info'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::EscapableHandleScope::~EscapableHandleScope()':
program.cpp:(.text._ZN4Napi20EscapableHandleScopeD2Ev[_ZN4Napi20EscapableHandleScopeD5Ev]+0xc): undefined reference to `napi_close_escapable_handle_scope'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::AsyncWorker::OnError(Napi::Error const&)':
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0x46): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0x71): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0x90): undefined reference to `napi_open_escapable_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0xb3): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0xde): undefined reference to `napi_call_function'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0xfa): undefined reference to `napi_is_exception_pending'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0x11c): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0x163): undefined reference to `napi_escape_handle'
program.cpp:(.text._ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE[_ZN4Napi11AsyncWorker7OnErrorERKNS_5ErrorE]+0x17a): undefined reference to `napi_close_escapable_handle_scope'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::AsyncWorker::OnOK()':
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0x6f): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0x93): undefined reference to `napi_open_escapable_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0xb6): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0xe8): undefined reference to `napi_call_function'
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0x104): undefined reference to `napi_is_exception_pending'
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0x126): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0x13d): undefined reference to `napi_close_escapable_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker4OnOKEv[_ZN4Napi11AsyncWorker4OnOKEv]+0x18b): undefined reference to `napi_escape_handle'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::Error::what() const':
program.cpp:(.text._ZNK4Napi5Error4whatEv[_ZNK4Napi5Error4whatEv]+0x42): undefined reference to `napi_open_escapable_handle_scope'
program.cpp:(.text._ZNK4Napi5Error4whatEv[_ZNK4Napi5Error4whatEv]+0x5f): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZNK4Napi5Error4whatEv[_ZNK4Napi5Error4whatEv]+0x81): undefined reference to `napi_get_named_property'
program.cpp:(.text._ZNK4Napi5Error4whatEv[_ZNK4Napi5Error4whatEv]+0xa2): undefined reference to `napi_escape_handle'
program.cpp:(.text._ZNK4Napi5Error4whatEv[_ZNK4Napi5Error4whatEv]+0xc1): undefined reference to `napi_close_escapable_handle_scope'
program.cpp:(.text._ZNK4Napi5Error4whatEv[_ZNK4Napi5Error4whatEv]+0xdd): undefined reference to `napi_get_value_string_utf8'
program.cpp:(.text._ZNK4Napi5Error4whatEv[_ZNK4Napi5Error4whatEv]+0x147): undefined reference to `napi_get_value_string_utf8'
CMakeFiles/program.dir/src/program.cpp.o: In function `Napi::AsyncWorker::OnWorkComplete(Napi::Env, napi_status)':
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x3b): undefined reference to `napi_open_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x6c): undefined reference to `napi_create_string_utf8'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x88): undefined reference to `napi_create_error'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0xff): undefined reference to `napi_create_reference'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x142): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x172): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x19c): undefined reference to `napi_open_escapable_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x1bf): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x1ed): undefined reference to `napi_call_function'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x20c): undefined reference to `napi_is_exception_pending'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x231): undefined reference to `napi_escape_handle'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x24e): undefined reference to `napi_close_escapable_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x2b3): undefined reference to `napi_close_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x377): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x3a1): undefined reference to `napi_open_escapable_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x3c4): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x3fc): undefined reference to `napi_call_function'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x41b): undefined reference to `napi_is_exception_pending'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x440): undefined reference to `napi_escape_handle'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x45d): undefined reference to `napi_close_escapable_handle_scope'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x491): undefined reference to `napi_delete_reference'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x4c2): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x532): undefined reference to `napi_get_reference_value'
program.cpp:(.text._ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status[_ZN4Napi11AsyncWorker14OnWorkCompleteENS_3EnvE11napi_status]+0x778): undefined reference to `napi_delete_reference'
CMakeFiles/program.dir/src/program.cpp.o: In function `_register_mobilenetknn':
program.cpp:(.text.startup+0x6): undefined reference to `napi_module_register'
collect2: error: ld returned 1 exit status
CMakeFiles/program.dir/build.make:161: recipe for target 'program' failed
make[2]: *** [program] Error 1
CMakeFiles/Makefile2:110: recipe for target 'CMakeFiles/program.dir/all' failed
make[1]: *** [CMakeFiles/program.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
ERR! OMG Process terminated: 2
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo#1.0.0 install: `cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo#1.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/nishant/.npm/_logs/2021-05-25T19_38_32_738Z-debug.log
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(mobilenetknn)
set(CMAKE_CXX_STANDARD 11)
SET(Caffe_DIR /home/nishant/caffe/distribute)
include_directories(${CMAKE_JS_INC})
include_directories(${Caffe_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/node_modules/node-addon-api)
file(GLOB_RECURSE SOURCE_O ${CMAKE_CURRENT_SOURCE_DIR}/lib/*.o GLOB SOURCE_FILES "src/*.cpp" "src/*.hpp")
# file(GLOB SOURCE_FILES "src/*.cpp" "src/*.hpp")
add_library(${PROJECT_NAME}
STATIC ${SRC}
${SOURCE_O} ${CMAKE_JS_SRC})
# add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
# add_library(SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
add_definitions(-DCPU_ONLY)
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_JS_LIB} ${Caffe_DIR}/lib/libcaffe.a)
SET(EXAMPLES
program
)
# License source files
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
find_package( OpenCV REQUIRED)
set(CMAKE_BUILD_TYPE release)
set(CMAKE_CXX_STANDARD 11)
add_definitions(-DCPU_ONLY)
find_package(HDF5 COMPONENTS HL REQUIRED)
include_directories(SYSTEM ${HDF5_INCLUDE_DIRS} ${HDF5_HL_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES})
list(APPEND Caffe_LINKER_LIBS ${HDF5_HL_LIBRARIES})
execute_process(COMMAND node -p "require('node-addon-api').include"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE NODE_ADDON_API_DIR
)
string(REPLACE "\n" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
string(REPLACE "\"" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
target_include_directories(${PROJECT_NAME} PRIVATE ${NODE_ADDON_API_DIR} ${CAMKE_JS_INC})
# target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/node_modules/node-addon-api")
# target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_JS_LIB})
add_definitions(-DNAPI_VERSION=3)
include_directories(${OpenCV_DIR}/include)
foreach (example ${EXAMPLES})
add_executable(${example} src/${example}.cpp)
TARGET_LINK_LIBRARIES(${example} ${OpenCV_LIBS} ${CMAKE_CURRENT_LIST_DIR}/build/libmobilenetknn.a ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} -lopenblas -lprotobuf -lboost_system -lglog -lgflags -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_ml -lopencv_imgcodecs -lopencv_videoio -lboost_system -lboost_regex -lboost_filesystem -lboost_thread -lboost_log)
endforeach()
main file(program.cpp)
I commented some of the functions, the same problem was with other functions also.
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/ml.hpp>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
// #include "napi.h"
#include <napi.h>
// #include <node_modules/node-addon-api/napi.h>
using namespace std;
using namespace cv;
using namespace cv::ml;
// using namespace Napi;
struct classInfo{
int classid;
std::string classname;
std::string imageset_location;
};
class Classify{ // declaration of class classify
public:
Classify(); //constructor
~Classify(); //destructor
std::vector<classInfo>cls;
int counter=0;
Ptr<KNearest> trainedModel;
std::string infer(std::string data_path);
void loadModel(string knn_path="train.knn");
std::string exportTrainedModel();
void trainModel(vector<classInfo>cls);
void listClasses(vector<classInfo>n);
vector<classInfo> addClass(std::string classname, std::string imageset_location);
};
Classify ic;
Napi::Number classAddTrainModel(const Napi::CallbackInfo& info){
Napi::Env env = info.Env();
// number of classes
int n = info[0].ToNumber();
Napi::Array classn = info[1].As<Napi::Array>();
Napi::Array iloc = info[2].As<Napi::Array>();
vector<classInfo> classinfo;
for(int i = 0; i < n; i++){
Napi::Value x = classn[i];
Napi::Value y = iloc[i];
string className = (string)x.As<Napi::String>();
string loc = (string)y.As<Napi::String>();
// cout << className << endl << loc << endl;
classinfo = ic.addClass(className, loc);
}
// Train Model
ic.trainModel(classinfo);
return Napi::Number::New(env, 1);
}
// Napi::String modelExport(const Napi::CallbackInfo& info){
// Napi::Env env = info.Env();
// std::string path = ic.exportTrainedModel();
// return Napi::String::New(env, ic.exportTrainedModel());
// }
// Napi::String modelLoad(const Napi::CallbackInfo& info){
// Napi::Env env = info.Env();
// std::string modelPath = info[0].ToString();
// std::string imgPath = info[1].ToString();
// ic.loadModel(modelPath);
// std::string label = ic.infer(imgPath);
// return Napi::String::New(env, label);
// }
Napi::Object Init(Napi::Env env, Napi::Object exports){
// set a key on exports object
exports.Set(
Napi::String::New(env, "classAddTrainModel"),
Napi::Function::New(env, classAddTrainModel)
);
// exports.Set(
// Napi::String::New(env, "modelExport"),
// Napi::Function::New(env, modelExport)
// );
// exports.Set(
// Napi::String::New(env, "modelLoad"),
// Napi::Function::New(env, modelLoad)
// );
// return 'exports' object (always)
return exports;
}
// register 'greet' module which calls Init method
NODE_API_MODULE(mobilenetknn, Init);
int main(){
return 0;
}
Related
I'm opening a dynamic library with a call to dlopen():
void *handle = dlopen("mylib.so", RTLD_LAZY | RTLD_GLOBAL);
if (!handle)
printf("%s", dlerror());
When this is called for a library which has an undefined symbol, the returned handle is NULL and I get the following printed in TTY:
libmylib.so: undefined symbol: < the_symbol_name >
This is fine. But when I call this same code for the same library name for the second time, the returned handle is NOT NULL, and I get a crash when dereferencing it.
From the docs:
If dlopen() fails for any reason, it returns NULL.
So why isn't NULL returned the second time?
I am trying to cross compile the gcc for linux - i686-elf platform from windows PC. As per the toolchain steps, I have successfully compiled:
binutils using
/binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
basic gcc using
gcc-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
linux headers using
make headers_install ARCH=i386 CROSS_COMPILE=i386-linux- INDTALL_HDR_PATH=my/path/
NOW, I am trying to compile the 'glibc' core c library using
`CC=${TARGET}-gcc ../glibc-2.29/configure --target=$TARGET --host=i686-pc-linux-gnu --prefix=$PREFIX --with-headers=my/path/`
BUT I am getting the follwing errors :(
/home/MyPC/src/glibc-2.29/elf/../sysdeps/unix/sysv/linux/not-cancel.h:57: undefined reference to `__GI___close_nocancel'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `invalid_name':
/home/MyPC/src/glibc-2.29/elf/../sysdeps/posix/opendir.c:43: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__fxstatat64':
/home/MyPC/src/glibc-2.29/elf/../sysdeps/unix/sysv/linux/fxstatat64.c:55: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/elf/../sysdeps/unix/sysv/linux/fxstatat64.c:37: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__closedir':
/home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/closedir.c:52: undefined reference to `__GI___close_nocancel'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/closedir.c:36: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__readdir':
/home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/readdir.c:41: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/readdir.c:76: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/readdir.c:71: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__rewinddir':
/home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/rewinddir.c:31: undefined reference to `__lseek'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__getdents':
/home/MyPC/src/glibc-2.29/dirent/../sysdeps/unix/sysv/linux/getdents.c:96: undefined reference to `__lseek64'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/unix/sysv/linux/getdents.c:99: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/unix/sysv/linux/getdents.c:54: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__fdopendir':
/home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/fdopendir.c:32: undefined reference to `__GI___fxstat64'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/fdopendir.c:41: undefined reference to `__GI___fcntl64_nocancel'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/fdopendir.c:36: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/dirent/../sysdeps/posix/fdopendir.c:46: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__libc_scratch_buffer_set_array_size':
/home/MyPC/src/glibc-2.29/malloc/scratch_buffer_set_array_size.c:41: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__mmap':
/home/MyPC/src/glibc-2.29/misc/../sysdeps/unix/sysv/linux/mmap.c:39: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/glibc-2.29/misc/../sysdeps/unix/sysv/linux/mmap.c:42: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `munmap':
/home/MyPC/src/glibc-2.29/misc/../sysdeps/unix/syscall-template.S:78: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__mprotect':
/home/MyPC/src/glibc-2.29/misc/../sysdeps/unix/syscall-template.S:78: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `uname':
/home/MyPC/src/glibc-2.29/posix/../sysdeps/unix/syscall-template.S:78: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__libc_sigaction':
/home/MyPC/src/glibc-2.29/signal/../sysdeps/unix/sysv/linux/sigaction.c:58: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `__sigaction':
/home/MyPC/src/glibc-2.29/signal/../nptl/sigaction.c:26: undefined reference to `rtld_errno'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/librtld.os: in function `setitimer':
/home/MyPC/src/glibc-2.29/time/../sysdeps/unix/syscall-template.S:78: undefined reference to `__syscall_error'
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: /home/MyPC/src/build-glibc/elf/ld.so.new: hidden symbol `__lseek64' isn't defined
/home/MyPC/opt/cross/lib/gcc/i686-elf/7.4.0/../../../../i686-elf/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:496: /home/MyPC/src/build-glibc/elf/ld.so] Error 1
make[2]: Leaving directory '/home/MyPC/src/glibc-2.29/elf'
make[1]: *** [Makefile:258: elf/subdir_lib] Error 2
make[1]: Leaving directory '/home/MyPC/src/glibc-2.29'
make: *** [Makefile:9: all] Error 2
This is likely due to the fact that glibc can only be built on case-sensitive file systems. You will have to switch the file system that hosts the build tree into case-sensitive mode.
I'm trying to create a static executable which depends on text-icu.
Here is the minified example https://github.com/4e6/text-icu-static-example
To enable static linking, I build icu with --enable-static flag here:
# http://userguide.icu-project.org/packaging#TOC-Link-to-ICU-statically
icu-static = pkgs.icu.overrideAttrs (attrs: {
dontDisableStatic = true;
configureFlags = (attrs.configureFlags or "") + " --enable-static";
outputs = attrs.outputs ++ [ "static" ];
postInstall = ''
mkdir -p $static/lib
mv -v lib/*.a $static/lib
'' + (attrs.postInstall or "");
});
And add following ghc options here:
configureFlags = [
"--ghc-option=-optl=-static"
"--ghc-option=-optl=-pthread"
"--ghc-option=-optl=-L${pkgs.glibc.static}/lib"
"--ghc-option=-optl=-L${pkgs.gmp6.override { withStatic = true; }}/lib"
"--ghc-option=-optl=-L${icu-static.static}/lib"
];
As a result of nix-build ., I'm getting a lot of errors about undefined references, see nix-build.log:
/nix/store/2h1il2pyfh20kc5rh7vnp5a564alxr21-icu4c-59.1-static/lib/libicui18n.a(regexcmp.ao):(.text+0x7805): more undefined references to `icu_59::UVector64::setElementAt(long, int)' follow
/nix/store/2h1il2pyfh20kc5rh7vnp5a564alxr21-icu4c-59.1-static/lib/libicui18n.a(regexcmp.ao): In function `icu_59::RegexCompile::compile(UText*, UParseError&, UErrorCode&)':
(.text+0x8355): undefined reference to `__cxa_throw_bad_array_new_length'
/nix/store/2h1il2pyfh20kc5rh7vnp5a564alxr21-icu4c-59.1-static/lib/libicui18n.a(regexcmp.ao):(.data.rel.ro._ZTIN6icu_5912RegexCompileE[_ZTIN6icu_5912RegexCompileE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
This setup works with other libraries but fails with text-icu. Any ideas on what I'm doing wrong?
link to github issue
I tried to compile "controllgallery2.nim" , but ..
Error: execution of an external compiler program 'gcc.exe -c -w -mno-ms-bitfields -IC:\Users(User name)\Documents\Language\Nim\nim-0.18.0\lib -o G:\Nim \nimcache\win_debug.cpp.obj C:\Users(User name).nimble\pkgs\ui-0.9.2\ui./libui/windows\debug.cpp' failed with exit code: 1 C:\Users\terur.nimble\pkgs\ui-0.9.2\ui./libui/windows\debug.cpp: In function 'void realbug(const char*, const char*, const char*, const char*, con st char*, va_list)': C:\Users(User name).nimble\pkgs\ui-0.9.2\ui./libui/windows\debug.cpp:76:31: error: 'vsprintf_s' was not declared in this scope vsprintf_s(msg, n, format, ap); ^
What I should do to fix that error?
I built OpenSS1.0.2g for SmartfoxClient API 1.6.3 (Cocos2dx v3 - Android - Window10 64bit). It throws error: Error SSL archive symbol table (run ranlib).
My config in Android.mk
LOCAL_CFLAGS += -I$(LOCAL_PATH)/boost
LOCAL_CFLAGS += -I$(LOCAL_PATH)/OpenSSL/include
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libs/smartfox
LOCAL_LDLIBS += -L$(LOCAL_PATH)/lib
LOCAL_LDLIBS += -L$(LOCAL_PATH)/OpenSSL/lib
LOCAL_LDLIBS += -lboost_system -lboost_thread -lboost_regex -lcrypto -lssl
LOCAL_CPPFLAGS += -fexceptions
LOCAL_CPPFLAGS += -frtti
LOCAL_CPPFLAGS += -w
Detail for error:
D:/Application/Cocos2d-x/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: crypto: no archive symbol table (run ranlib)
D:/Application/Cocos2d-x/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.exe: error: ssl: no archive symbol table (run ranlib)
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:34: error: undefined reference to 'EVP_CIPHER_CTX_init'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:47: error: undefined reference to 'EVP_aes_128_cbc'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:47: error: undefined reference to 'EVP_CipherInit_ex'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:52: error: undefined reference to 'EVP_CipherUpdate'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:57: error: undefined reference to 'EVP_CipherFinal_ex'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:64: error: undefined reference to 'EVP_CIPHER_CTX_cleanup'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:75: error: undefined reference to 'EVP_CIPHER_CTX_init'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:88: error: undefined reference to 'EVP_aes_128_cbc'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:88: error: undefined reference to 'EVP_CipherInit_ex'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:93: error: undefined reference to 'EVP_CipherUpdate'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:98: error: undefined reference to 'EVP_CipherFinal_ex'
jni/../libs/smartfox/Core/DefaultPacketEncrypter.cpp:105: error: undefined reference to 'EVP_CIPHER_CTX_cleanup'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:39: error: undefined reference to 'SSL_library_init'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:40: error: undefined reference to 'SSL_load_error_strings'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:41: error: undefined reference to 'OPENSSL_add_all_algorithms_noconf'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:43: error: undefined reference to 'CRYPTO_num_locks'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:46: error: undefined reference to 'CRYPTO_set_locking_callback'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:47: error: undefined reference to 'CRYPTO_set_id_callback'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:64: error: undefined reference to 'CRYPTO_set_id_callback'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:65: error: undefined reference to 'CRYPTO_set_locking_callback'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:66: error: undefined reference to 'ERR_free_strings'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:68: error: undefined reference to 'ERR_remove_thread_state'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:72: error: undefined reference to 'EVP_cleanup'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:73: error: undefined reference to 'CRYPTO_cleanup_all_ex_data'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:74: error: undefined reference to 'CONF_modules_unload'
jni/boost/asio/ssl/detail/impl/openssl_init.ipp:76: error: undefined reference to 'ENGINE_cleanup'
jni/boost/asio/ssl/impl/error.ipp:40: error: undefined reference to 'ERR_reason_error_string'
jni/boost/asio/ssl/impl/context.ipp:70: error: undefined reference to 'ERR_clear_error'
jni/boost/asio/ssl/impl/context.ipp:93: error: undefined reference to 'SSLv3_method'
jni/boost/asio/ssl/impl/context.ipp:93: error: undefined reference to 'SSL_CTX_new'
jni/boost/asio/ssl/impl/context.ipp:96: error: undefined reference to 'SSLv3_client_method'
jni/boost/asio/ssl/impl/context.ipp:96: error: undefined reference to 'SSL_CTX_new'
jni/boost/asio/ssl/impl/context.ipp:99: error: undefined reference to 'SSLv3_server_method'
jni/boost/asio/ssl/impl/context.ipp:99: error: undefined reference to 'SSL_CTX_new'
jni/boost/asio/ssl/impl/context.ipp:102: error: undefined reference to 'TLSv1_method'
jni/boost/asio/ssl/impl/context.ipp:102: error: undefined reference to 'SSL_CTX_new'
jni/boost/asio/ssl/impl/context.ipp:105: error: undefined reference to 'TLSv1_client_method'
jni/boost/asio/ssl/impl/context.ipp:108: error: undefined reference to 'TLSv1_server_method'
jni/boost/asio/ssl/impl/context.ipp:111: error: undefined reference to 'SSLv23_method'
jni/boost/asio/ssl/impl/context.ipp:114: error: undefined reference to 'SSLv23_client_method'
jni/boost/asio/ssl/impl/context.ipp:117: error: undefined reference to 'SSLv23_server_method'
jni/boost/asio/ssl/impl/context.ipp:121: error: undefined reference to 'TLSv1_1_method'
jni/boost/asio/ssl/impl/context.ipp:124: error: undefined reference to 'TLSv1_1_client_method'
jni/boost/asio/ssl/impl/context.ipp:127: error: undefined reference to 'TLSv1_1_server_method'
jni/boost/asio/ssl/impl/context.ipp:139: error: undefined reference to 'TLSv1_2_method'
jni/boost/asio/ssl/impl/context.ipp:142: error: undefined reference to 'TLSv1_2_client_method'
jni/boost/asio/ssl/impl/context.ipp:145: error: undefined reference to 'TLSv1_2_server_method'
jni/boost/asio/ssl/impl/context.ipp:163: error: undefined reference to 'ERR_get_error'
jni/boost/asio/ssl/impl/context.ipp:208: error: undefined reference to 'SSL_CTX_get_ex_data'
jni/boost/asio/ssl/impl/context.ipp:212: error: undefined reference to 'SSL_CTX_get_ex_data'
jni/boost/asio/ssl/impl/context.ipp:214: error: undefined reference to 'SSL_CTX_set_ex_data'
jni/boost/asio/ssl/impl/context.ipp:217: error: undefined reference to 'SSL_CTX_free'
jni/boost/asio/ssl/impl/context.ipp:286: error: undefined reference to 'SSL_CTX_ctrl'
jni/boost/asio/ssl/impl/context.ipp:393: error: undefined reference to 'ERR_clear_error'
jni/boost/asio/ssl/impl/context.ipp:395: error: undefined reference to 'SSL_CTX_set_default_verify_paths'
jni/boost/asio/ssl/impl/context.ipp:398: error: undefined reference to 'ERR_get_error'
jni/boost/asio/ssl/detail/impl/engine.ipp:38: error: undefined reference to 'SSL_new'
jni/boost/asio/ssl/detail/impl/engine.ipp:43: error: undefined reference to 'ERR_get_error'
jni/boost/asio/ssl/detail/impl/engine.ipp:50: error: undefined reference to 'SSL_ctrl'
jni/boost/asio/ssl/detail/impl/engine.ipp:51: error: undefined reference to 'SSL_ctrl'
jni/boost/asio/ssl/detail/impl/engine.ipp:53: error: undefined reference to 'SSL_ctrl'
jni/boost/asio/ssl/detail/impl/engine.ipp:57: error: undefined reference to 'BIO_new_bio_pair'
jni/boost/asio/ssl/detail/impl/engine.ipp:58: error: undefined reference to 'SSL_set_bio'
jni/boost/asio/ssl/detail/impl/engine.ipp:63: error: undefined reference to 'SSL_get_ex_data'
jni/boost/asio/ssl/detail/impl/engine.ipp:65: error: undefined reference to 'SSL_get_ex_data'
jni/boost/asio/ssl/detail/impl/engine.ipp:66: error: undefined reference to 'SSL_set_ex_data'
jni/boost/asio/ssl/detail/impl/engine.ipp:69: error: undefined reference to 'BIO_free'
jni/boost/asio/ssl/detail/impl/engine.ipp:70: error: undefined reference to 'SSL_free'
jni/boost/asio/ssl/detail/impl/engine.ipp:81: error: undefined reference to 'SSL_get_verify_callback'
jni/boost/asio/ssl/detail/impl/engine.ipp:81: error: undefined reference to 'SSL_set_verify'
jni/boost/asio/ssl/detail/impl/engine.ipp:99: error: undefined reference to 'SSL_get_ex_data'
jni/boost/asio/ssl/detail/impl/engine.ipp:100: error: undefined reference to 'SSL_get_ex_data'
jni/boost/asio/ssl/detail/impl/engine.ipp:102: error: undefined reference to 'SSL_set_ex_data'
jni/boost/asio/ssl/detail/impl/engine.ipp:105: error: undefined reference to 'SSL_get_verify_mode'
jni/boost/asio/ssl/detail/impl/engine.ipp:105: error: undefined reference to 'SSL_set_verify'
jni/boost/asio/ssl/detail/impl/engine.ipp:117: error: undefined reference to 'SSL_get_ex_data_X509_STORE_CTX_idx'
jni/boost/asio/ssl/detail/impl/engine.ipp:117: error: undefined reference to 'X509_STORE_CTX_get_ex_data'
jni/boost/asio/ssl/detail/impl/engine.ipp:179: error: undefined reference to 'BIO_read'
jni/boost/asio/ssl/detail/impl/engine.ipp:190: error: undefined reference to 'BIO_write'
jni/boost/asio/ssl/detail/impl/engine.ipp:204: error: undefined reference to 'BIO_ctrl'
jni/boost/asio/ssl/detail/impl/engine.ipp:218: error: undefined reference to 'SSL_get_shutdown'
jni/boost/asio/ssl/detail/impl/engine.ipp:238: error: undefined reference to 'BIO_ctrl_pending'
jni/boost/asio/ssl/detail/impl/engine.ipp:239: error: undefined reference to 'ERR_clear_error'
jni/boost/asio/ssl/detail/impl/engine.ipp:241: error: undefined reference to 'SSL_get_error'
jni/boost/asio/ssl/detail/impl/engine.ipp:242: error: undefined reference to 'ERR_get_error'
jni/boost/asio/ssl/detail/impl/engine.ipp:243: error: undefined reference to 'BIO_ctrl_pending'
jni/boost/asio/ssl/detail/impl/engine.ipp:277: error: undefined reference to 'SSL_get_shutdown'
jni/boost/asio/ssl/detail/impl/engine.ipp:292: error: undefined reference to 'SSL_accept'
jni/boost/asio/ssl/detail/impl/engine.ipp:297: error: undefined reference to 'SSL_connect'
jni/boost/asio/ssl/detail/impl/engine.ipp:311: error: undefined reference to 'SSL_read'
jni/boost/asio/ssl/detail/impl/engine.ipp:317: error: undefined reference to 'SSL_write'
jni/../libs/smartfox/Core/Sockets/TCPClientSSL.cpp:152: error: undefined reference to 'X509_STORE_CTX_get_current_cert'
jni/../libs/smartfox/Core/Sockets/TCPClientSSL.cpp:153: error: undefined reference to 'X509_get_subject_name'
jni/../libs/smartfox/Core/Sockets/TCPClientSSL.cpp:153: error: undefined reference to 'X509_NAME_oneline'
Which idea for fix error? Tks