vscode(Visual Studio Code) + oF

re: Load and Save dialogs. Guys, I’m using Ubuntu, I discovered today that load and save dialogs dont appear when compiling with the Make / VSCode. After some debugging in ofSystemUtils.cpp, I discovered it’s due to compiler directive not being defined : OF_USING_GTK

Are we missing setting it anywhere? Ideas?

Thanks for any tips!

vscode + oF is working great, thanks for all the effort @hrs
I’m trying it out again to test this plugin

Two suggestions:
now I can only run if I choose Release. Debug builds but doesn’t invoke built program.
And I have all addons listed on VSCode. it would be great to have listed only those in addons.make file
Cheers

I remember I couldn’t automate starting debug process after run debug and end up just hit F5 mamually.

(To compile debug, you can select from command palette.)

Edit:
And yes, addon listing is next thing we can update.

Thank you for your feedback!

1 Like

Guys, I know this is a bit of a fragmented thread, but for anyone looking to reduce / hide warnings when compiling, you can add

CXXFLAGS += -w

to the Makefile in your project, just before the compile.project.mk is included. ie:

This was in Ubuntu, but I think should work for other Env’s. If anyone knows of a better place to put this, please LMK!

1 Like

PS. Really do appreciate the effort put in by the community (esp @hrs) to get this working. I simply cannot go back to QT Creator, the debugging in VSCode is so superior! And ONE project acrowss Mac, Win, Linux due to the flexibility of VSCode project files.

2 Likes

Hi @hrs,

I’m having issues setting preprocessor definitions / compiler directives.

The make command seems to be ignoring them. Any ideas?!

and JSON equivalent:

(EDIT: I have ediited my config.make file) PROJECT_DEFINES= section to make it work for now, but I thought the point was to use the c_cpp_properies.json file

Any help appreciated!

Not sure but might be solved by using =

Hey @hrs
Thanks for the contribution, I have been looking into this for implementing this on windows, and I was going down the msys2 route, but I have been having some trouble with this

I looked into the config and I saw that you went with the visual studio version of the make for the windows build rather than the msys2 make version.
Do you think that would be better rather than the complications of adding in msys2 or hmm?
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*

Hello,

Are you maybe trying my repo “vscode_oF”?
It seems c_cpp_properties.json is outdated. ( sorry I will update asap -> EDIT: done)

Instead of that repo, please refer to vscode files in openFrameworks master.

You can see the setting for mingw like below.

I tried this setting with latest commandline PG right now and it still compiles/runs without problems. (Windows 10 and latest oF master, latest PG)

However vscode Windows template is not very well tested on my side since I’m using VS2017 in most of case. Please send PR if you find a better configuration.

This morning, new updates for vscode and template feature is merged into oF & PG master repo. Now we can generate&update vscode project via frontend PG. (Thanks arturo!)

So far I tested under,

  • macOS High Sierra
  • Windows 10, mingw
  • Linux Ubuntu 16.4

Since I can not conduct all tests for all platforms + OS combination, it would be great if you could try on your environment.

How to test?

  1. checkout latest master, both of oF and PG
  2. execute download script, etc.
  3. check if you can compile example project with make command.
  4. compile commandline PG
  5. compile frontend PG
  6. Run PG frontend and turn on advanced mode
  7. Select vscode from template dropdown.

Please follow official document how to compile PG.

It would be nice to start testing in this month in order to provide ideas (and bugs) to coming oF conference in October.

2 Likes

great. I’ve tried now updating only the command line and I get the following error

/Volumes/tool/openFrameworks/apps/projectGenerator/ofxProjectGenerator/src/addons/ofAddon.cpp:12:10: 
'Poco/String.h' file not found

I think your system can not find Poco. Have you run install_dependency.sh? Or download_lib.sh?

If you are on Linux, you might need apothecary update poco.

im just trying the nightly builds of oF to use vscode on macOS.
I can say it starts fine & can make a vscode project. it asks for the c/c++ intelligence package & I have installed it but have not done anything else.

is there any other steps to getting set up? I have tried a simple f5 to run things after the package install, but it does say that there is not a debug application. so just asking for extra pointers in getting this to work

thanks again for all the work you have put into this

ah wait… I may have something I did forget :wink:

well… on that thing I tried, which was the Run Build Task - I can do f5 to some degree. it does do something bu does crash it seems. these are the screenshots of what happened once doing a run of things with f5

Hi!

This is so great, I would like to edit the plist to display in high resolution mode however each time I build the plist reverts back without my edits.

Hi, PG only copy files when you hit update or generate button. So your issue is not related to PG. It might be related to the build script of Xcode project.

Thank you! I’m not using the PG, just editing the plist from VS code. However it may be a little over my head.

Thanks for sharing this!
I Can compile and Run / Debug any project in VS code for Ubuntu.
Though, to get intelisense working with everything inside addons, I’m needing to manually list paths to some subfolders inside the c_cpp_properties.json files.
e.g.:
“${workspaceRoot}/…/…/…/addons/ofxGui/src”,
“${workspaceRoot}/…/…/…/addons/ofxOpenCv/src”,
“${workspaceRoot}/…/…/…/addons/ofxOpenC/libs/opencv/include/opencv”

I’m wondering if anyone knows a way to automate this process

Hello,
We still don’t have this feature in PG.
You can check PG commandline project, must be not so complicated.

Hiroshi

I dont know whether anyone has ran into this. but im getting the same problem over & over again & dont know what to do