build in commandline

  • gcc/g++
g++ -o draw4graph -std=c++17 -O0 -ggdb draw.cpp myevent.cpp -I. -losg -losgDB -losgGA -losgUtil -losgViewer
  • msvc

CFLAGS=/W4 /Wv:18 /WX- /Zi /MTd /Gy /Gm- /Zl /Od /DDETOURS_BITS=$(DETOURS_BITS) /WX 是警告被视为错误,而 /WX- 是警告不被视为错误

set CFLAGS=/W4 /WX- /std:c11 /wd4996 /wd5105 /FC /TC /Zi /nologo
set INCLUDES=/I dependencies\SDL2\include /I dependencies\GLFW\include /I dependencies\GLEW\include /I F:\miniconda3\pkgs\freetype-2.12.1-hdaf720e_2\Library\include /I .
set LIBS=dependencies\SDL2\lib\x64\SDL2.lib ^
         dependencies\SDL2\lib\x64\SDL2main.lib ^
         dependencies\GLFW\lib\glfw3.lib ^
         dependencies\GLEW\lib\glew32s.lib ^
         opengl32.lib User32.lib Gdi32.lib Shell32.lib ^
		 F:\miniconda3\pkgs\freetype-2.12.1-hdaf720e_2\Library\lib\freetype.lib

cl.exe %CFLAGS% %INCLUDES% /Feded src\main.c src\la.c src\editor.c src\file_browser.c src\free_glyph.c src\simple_renderer.c src\common.c /link %LIBS% -SUBSYSTEM:windows
cl /o draw4graph draw.cpp myevent.cpp /std:c++17 /I "C:\dev\OpenSceneGraph-3.6.5-VC2019-64-Release\include" /link /LIBPATH:"C:\dev\OpenSceneGraph-3.6.5-VC2019-64-Release\lib" osg.lib osgDB.lib osgGA.lib osgUtil.lib osgViewer.lib
cl.exe /LD <files-to-compile>
cl.exe /D_USRDLL /D_WINDLL <files-to-compile> <files-to-link> /link /DLL /OUT:<desired-dll-name>.dll

https://blog.csdn.net/wgx571859177/article/details/80394019

除额外注明的地方外,本维基上的内容按下列许可协议发布: CC Attribution-Share Alike 4.0 International