Skip to content

Instantly share code, notes, and snippets.

@tilkinsc
Last active January 16, 2019 18:29
Show Gist options
  • Save tilkinsc/3a9f4a9f21be31a90bd226b3dac40f60 to your computer and use it in GitHub Desktop.
Save tilkinsc/3a9f4a9f21be31a90bd226b3dac40f60 to your computer and use it in GitHub Desktop.
Conversion from GCC to MSVS advice

Advice

  • Use CL instead of GCC
  • Use .lib and .dll instead of just .dll.a and .dll (and .so.a and .so)
  • Object files are now .obj instead of .o
  • Use /O2 and /Wall instead of -O2 and -Wall
  • Use /Iincdir instead of -Iincdir
  • I'm not sure, but probably /Llibdir instead of -Llibdir

Regular program

CL.exe /O2 /Wall /Ddefine=value [sources.c] [libraries.lib]

DLL (generates the .lib)

CL.exe /O2 /Wall /D_USRDLL /D_WINDLL [sources.c] [libraries.lib] /link /DLL /OUT:dllname.dll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment