0

I'm trying to write a C program that uses SDL2, using VSCode on OSX.

  • Is there some standard way to link external libraries to C/C++ projects in VSCode? It took me hours just to figure out how to get the SDL.h header file to include properly -- apparently this must be done by manually adding "-I", "<path/to/include/directory>" to the launch.json file under the entry for building with clang.

  • Assuming a pure command-line invocation, I need -I <include-path>, but I'm unclear how to also link the binary(s) for libraries...

  • Is it kosher to use homebrew to install SDL and leave the files in the homebrew Cellar directory, or must I copy them to the /Library/Frameworks directory? If yes to latter, what is the canonical way to do this?

  • Does VSCode's c_cpp_properties.json file ONLY impact its IntelliSense stuff and have no bearing on compilation?

  • Is "gcc" just a "front-end" wrapping clang on OSX? And is clang distinct from llvm? I'm confused why both commands were installed by xcode-select --install, and things I've read by googling do not clear up the confusion.

  • Should I be using a Makefile? Or is that redundant to VSCode's C/C++ extension .json files? Or should I configure everything in launch.json? Or settings.json? (I have no idea how to write a Makefile...)

Can anyone help?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Jason Boyd
  • 1,192
  • 1
  • 9
  • 19

0 Answers0