Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hiroMTB/cb28643ae95614c740b93aef58efafe4 to your computer and use it in GitHub Desktop.
Save hiroMTB/cb28643ae95614c740b93aef58efafe4 to your computer and use it in GitHub Desktop.
A quick reminder on how to use openframeworks without XCode (macOS)
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1",
"~/Documents/Code/of_v0.9.8_osx_release/libs",
"~/Documents/Code/of_v0.9.8_osx_release/addons"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
]
}

Using OpenFrameworks with Visual Studio Code (macOS)

  1. First, install the cpptools extension in studio code

  2. Then add the include paths in the c_cpp_properties.json file.

    If a small light bulb icon (💡) appears near the include statements on any of your source file, just click it in order to access the c_c_pp_properties.json file.

    If there's no 💡 icon, then in the project directory create a hidden folder called vscode:

    mkdir .vscode

    Then inside this folder create the c_c_pp_properties.json.

    I uploaded a sample file in this gist, so you can use it as a template.

    The paths are those (obviously will change depending on where you downloaded openframeworks and on your XCode installation):

    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/"
    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1"
    "~/Documents/Code/of_v0.9.8_osx_release/libs"
    "~/Documents/Code/of_v0.9.8_osx_release/addons"
    
  3. Create a new project using the project generator

  4. Modify the ofApp source code as you need

  5. Finally, run the make command in your working folder (above the src dir)

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