Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbols defined through #pragma include <filename> are producing squiggle errors as "undefined variable" but are working fine at compile time. #57

Closed
mgs opened this issue Apr 26, 2020 · 1 comment

Comments

@mgs
Copy link

mgs commented Apr 26, 2020

Installed product versions

  • Visual Studio: 2017
  • This extension: 0.7.98

Description

Thank you for your work on this extension!

Symbols from included files are not being recognized as defined. I see that in version 0.7.0 a change is listed for recursive include? Is there anything special I need to be doing?

Steps to recreate

  1. at top of file #pragma include "<filename>"
  2. use symbols from <filename>
  3. squiggle lines appear beneath the symbols and debugger shows errors that look like:
    0(33) : error C1503: undefined variable "surfaceWidth"
@mgs mgs closed this as completed Apr 26, 2020
@mgs mgs reopened this Apr 26, 2020
@mgs
Copy link
Author

mgs commented Apr 26, 2020

Aha! The extension does not like my use of #pragma. After wrangling with this for a while I finally managed to use the "controlling with comments" feature correctly. For what it's worth, to me, the description in the readme is confusing and the provided examples didn't seem exactly relevant to my situation.

Using OpenFrameworks (C++) what this turned out to mean for me was that in my shaders if I want to include a file named "sdfUtils.glsl" like:

#pragma include "sdfUtils.glsl"

I need to do this instead:

#pragma include "sdfUtils.glsl" //! #include "sdfUtils.glsl"

Now it's working nicely. Thanks again for your work on this extension, it's useful to me and I appreciate it! I wish I could offer a better alternative to the current description in the readme but I'm afraid I still don't fully understand the reasons it was necessary to do this.

@mgs mgs closed this as completed Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant