Category : shared-libraries

My GUI code compiles fine but when I click on a button which does some computation, I get the following error : ./main_exe: symbol lookup error: ./main_exe: undefined symbol: clfftInitSetupData I don’t understand given that nm -D output : nm -D /usr/local/lib64/libclFFT.so | grep clfftInitSetupData 00000000000acfb0 T clfftInitSetupData So this function clfftInitSetupData should be known ..

Read more

So I’ve learnt that it’s best to first declared function in header file, than define it in a seperate .cpp file as function definition within headers aren’t recommended. And I did so, with normal function and it worked. but when I try to do the same thing with template functions, it gave back error like ..

Read more

Trying to test a simple case where a global variable defined in a shared library is set by a program and used by the shared library, I saw a strange problem. Here are the program codes. bar.cpp #include <stdint.h> #include <stdio.h> extern "C" { uint64_t var_from_lib; } class BC; class BC { public: void bar(void); ..

Read more

When I am using using extern "C" with __declspec(dllexport) in the Class, then I am getting an error "linkage specification is not allowed". If i declare this outside of the class then i am not getting any error. Could someone please help me how to use extern "C" with __declspec(dllexport) with in the Class Below ..

Read more

I have a project where I link to boost; the CMakeLists.txt looks like this: project(test VERSION 1.0) set(CMAKE_CXX_COMPILER /usr/bin/g++) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -Wall -Wextra -Wfloat-equal -Wundef -Wcast-align -Wwrite-strings -Wlogical-op -Wredundant-decls -Wshadow -Woverloaded-virtual") find_package(Boost COMPONENTS filesystem program_options log log_setup REQUIRED) include_directories( ${Boost_INCLUDE_DIRS} ) add_executable(test src/test.cpp) target_link_libraries(test LINK_PUBLIC ${Boost_LIBRARIES} config++ ) install(TARGETS test ..

Read more