I am able to successfully compile and execute a sample C++ program which includes boost library through windows command prompt.
I want to use make and hence I want to use CMAKE(3.15) with MinGW g++.
I used cmake-gui, CLION, and cmake
on cmd prompt
Very unfortunately i am not able to find the compiler flag "-lws2_32" included through CMakeLists.txt
I found different solutions on StackOverflow but none helped me.
Below is the CMakeLists.txt
cmake_minimum_required (VERSION 3.14.0)
project (BoostCMakeTutorial)
set(GCC_BOOST_COMPILER_FLAG "-lws2_32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_BOOST_COMPILER_FLAG}")
add_executable(BoostCMakeTutorial boostTcpClient.cpp)
I am sure on "-lws2_32" flag is missing from CMAKE because i see the same error on cmd prompt when this not included