PhantomBot icon indicating copy to clipboard operation
PhantomBot copied to clipboard

(info) Compiling without VS - With GCC

Open HumbleDeer opened this issue 3 years ago • 0 comments

If you are compiling without Visual Studio/MSVC, you will have to add the linked library for WinSockets yourself; Visual Studio's compiler uses a pragma system, GCC does not. VS: #pragma comment(lib, "ws2_32")

For myself in CodeBlocks, this means:

  • Cloning a fresh repo (ensure no cmake garbage is left)
  • Creating a new project and including all folders and files
  • Project -> Build Options -> Linker
  • Add "ws2_32" as a library; no path or .lib

For projects compiling with libraries linked in the GCC Commandline, use -L"ws2_32"

The project should now compile without "_imp." errors.

HumbleDeer avatar May 30 '21 09:05 HumbleDeer