vscode(Visual Studio Code) + oF

#12

Great work! But maybe I miss something – how is it possible to add addons to the project so that they compile?
I can see the addons folder in the workspace, I’ve also added the particular addon’s path to includePath and browse.path in c_cpp_properties.json, I’ve included the addon’s name in the addons.make file, but I’m still getting this when trying to build:

fatal error: ‘ofxOsc.h’ file not found
#include “ofxOsc.h”

I’m on OS 10.12.6 and oF 0.10.1 with C++ from Microsoft and C++ Intellisense installed. I’ve got no idea what could be done more. Please, help!

#13

Hello slavo.

Please try this tutorial https://www.youtube.com/watch?v=TczI-tSOIpY
(033 ofxOsc input basics) or clone code from https://github.com/lewislepton/openFrameworksTutorialSeries/

I hope it helps

1 Like
#14

ill give it a shot in theory i can just use the one from QTcreator and replace with VS CODE?

#15

yes you can use it as a template

#16

Hello, just started working on it.

Any suggestion, commits, help are appreciated.

4 Likes
#17

Yo!
I uploaded compiled alpha version on Google drive.
Currently only OSX app.
I will bake for Linux and Windows tomorrow.
https://drive.google.com/drive/folders/1WuqmM1Eyc9XXuxp7BjgWKDFvfBX07K7A?usp=sharing

How to

  1. Check README.txt
  2. unzip
  3. double click app
  4. select Visual Studio Code from dropdown list
  5. Please report here or github if something went wrong.
5 Likes
#18

By the way the new release of VS code implements remote editing and debugging in various flavors, just having a peek at that now but it looks very promising

#19

Oh nice, does it work with C++?
Do we need to add some lines to configuration file?

Once we add vscode support to PG, we can easily modify and test new feature by editing template files in /scripts/template/vscode.

#20

According to the docs it should work, I had some issues but didn’t really try that hard. The blog post about the feature is here

[EDIT] Once tasks.json and launch.json are properly configured remote building and debugging works like a charm, you have all console messages in VScode terminal.

Just be careful to add

        "env": {"DISPLAY":":0"},

to the linux section of launch.json, so that OF application will be able to find and open the X11 display. Assuming that remote host is Linux, of course.

2 Likes
#21

I can say that this is currently working for myself. it created & started up a viscose project - just trying a simple build & running of it

in many ways id love to cut out using Xcode. whilst its great for really heavy use & to test things with tools to measure memory etc. sometimes you just need something to run code :wink:

ill give an update if anything changes or if there are specific problems

is there any way to have a RunDebug setting. doing a build pops up with debug build, but not running

thanks again for this. great work :wink:

1 Like
#22

Hit F5 key to start debugging.

1 Like
#23

This is great! Is there any talk of getting this merged into the official PG repo ?

#24

It’s already merged into latest master. The PR above is closed because we decided another solution(using template feature). Right now you can only generate vscode project via command line PG. After checkout latest master and install command line PG, try following cmd.
projectGenerator -o"your/oF/" -t"vscode" your/project

More details here

2 Likes
#25

Thanks for your excellent work. It works great until I need an addon. When I compile I get the same ‘undefined reference to …’ egimage

#26

I’ve added the addons into the addons.make file:
image

Any ideas?

#27

Please try -a option of commandline PG and generate again.

#28

I’ve tried -a option and it actually erased everything inside addons.make.

#29

Try adding all name of addons you need like this

projectGenerator -o"youroF" -a"ofxGui ofxCv" -t"vscode" your/project

Please refer to this page for more about how to use Commandline PG

#30

Hey, i´m trying to start with openframeworks but i can´t get it working with vs code.
i installed everything and it works with xcode. How do i install the commandline PG?
if i paste ‘projectGenerator -t"vscode" your/project’ into Terminal (in openframeworks root directory) it says
‘-bash: projectGenerator: command not found’

#31

I think vscode feature is bit advanced if you are new to C++ programming. If you really want to use oF with vscode, please send me PM I’m happy support. But I recommend to start from Xcode, I also use often.