I have build my quickfix C++ source code with the SSL support using below command. My quickfix library got build successfully.
On Linux (with system openssl),
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_SSL=ON -DCMAKE_INSTALL_PREFIX:PATH="install-path" .. make -j 4 install
This is my Initiator code -
if (isSSL.compare("SSL") == 0)
initiator = new FIX::ThreadedSSLSocketInitiator ( application, storeFactory, settings, logFactory );
else
initiator = new FIX::SocketInitiator( application, storeFactory, settings, logFactory );
But while running this getting linking issue. What is the problem ?
CMakeFiles/TradingClient.dir/tradeclient.cpp.o: In function `main':
/mnt/d/TradingClient/tradeclient.cpp:47: undefined reference to `FIX::ThreadedSSLSocketInitiator::ThreadedSSLSocketInitiator(FIX::Application&, FIX::MessageStoreFactory&, FIX::SessionSettings const&, FIX::LogFactory&)'
collect2: error: ld returned 1 exit status
This my CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(TradingClient)
add_definitions(-DHAVE_SSL=1)
set(CMAKE_CXX_STANDARD 14)
set(quickfix_lib "/usr/lib/libquickfix.so")
add_executable(TradingClient Application.h Application.cpp tradeclient.cpp)
target_link_libraries(TradingClient ${quickfix_lib} )
if you go inside quickfix/src/C++/CMakeLists.txt
if (HAVE_SSL)
set (quickfix_SOURCES ${quickfix_SOURCES}
SSLSocketAcceptor.cpp
SSLSocketConnection.cpp
SSLSocketInitiator.cpp
ThreadedSSLSocketAcceptor.cpp
ThreadedSSLSocketConnection.cpp
ThreadedSSLSocketInitiator.cpp
UtilitySSL.cpp)
endif()
these files get build only with SSL . It means my quickfix library is correctly build because object files for these files got generated.
Although object files gets generated as part of library, still getting this linking issue that its not able to find the reference for these methods ThreadedSSLSocketInitiator()