vscode(Visual Studio Code) + oF

#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.

#32

brilliant! can’t wait merge to official one!

#33

hey @hrs, looks really nice!
I have seen in the OF repo a folder /openFrameworks/scripts/templates/vscode already present…
Should overwrite this with your google drive folder? or there is a newer way?
By default Project Generator do not display the Visual Code platform, I’ll test better and post here results.

#34

If you are on macOS and latest master repo, no need to replace template files. I checked now but seems like “Generate” feature does not work if I only select vscode template . Please select both of Xcode template and vscode template when you generate).

Windows, Linux users, please use command line PG.
Or if you are challenger, you can compile this working PR.

#35

cool. I am on MacOS. But I have the app of PG copied from the 0.10 zip from web… And PG is not listing VS Code… Should I build PG app by myself, right?

EDIT:
I compiled (the official) PG repo and it works, but not listing VS Code.
Nevermind, I’ll check again. I’ll check this PR you linked.
But PG build seems a bit messy… all the nested folders… openFrameworks inside openFrameworks…etc…

  1. I cloned the https://github.com/openframeworks/projectGenerator repo into /openFrameworks
  2. I run the builder script for PG into here (it seems important where you run it):
    MacBook:projectGenerator yourUser$ sh ./scripts/osx/buildPG.sh
#36

fyi,

  • Official PG(release zip) does not support template feature.
  • Compiled frontend app can be found in Google drive, but little outdated compared to PR above.
  • PG repo is included in the oF repo as a git submodule, does not need to be downloaded again. Please check this README
2 Likes
#37

Great! working here when chosing run task -> Build RELEASE.
not working with Build DEBUG
and some linker issues if using ofxSyphon

other than that running great with command line.
I’m using this to drag and drop folders and generate projects using addons.make

1 Like
#38

Nice job,

though I’m mainly using Emacs I’ll give it a shot and try it out. Is VSCode using LSP for auto-completion? If yes, do you have to generate a compile_commands.json?

1 Like
#39

No you don’t need to generate any file for autocomolete. vscode uses MS’s intelisense. It generate DB file in .vscode folder. Negative thing is, it becomes few GB sometimes. But you can specify DB file location in setting json.

3 Likes
#40

K, my bad I always thought VS Code would use LSP for auto completion since it’s a Microsoft thing :grinning: any experiences with LSP/VS Code/Openframeworks anyone?