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

parser.h seems to be playing badly with the windows API? #18

Open
marc-weber1 opened this issue Dec 4, 2020 · 2 comments
Open

parser.h seems to be playing badly with the windows API? #18

marc-weber1 opened this issue Dec 4, 2020 · 2 comments

Comments

@marc-weber1
Copy link

marc-weber1 commented Dec 4, 2020

I'm not sure if this is an error in the code or some names interfering with the windows API, but it should be noted that #include "parser.h" defaults to including a file from the windows API, so it might need a slight name change.

Even when getting around this issue using something like compiling all the files as a static library and using #include "glsl-parser/parser.h", the following error crops up, and I'm not sure whether it's related to name interference with the windows API:

  glsl-parser.lib(parser.obj) : error LNK2019: unresolved external symbol "private: static void __cdecl glsl::astNode<s
truct glsl::astVariable>::operator delete(void *)" (??3?$astNode@UastVariable@glsl@@@glsl@@CAXPEAX@Z) referenced in fun
ction "public: void * __cdecl glsl::astVariable::`scalar deleting destructor'(unsigned int)" (??_GastVariable@glsl@@QEA
APEAXI@Z) [E:\Users\facade\Documents\Github\skybox-painter\build\skyboxpainter.vcxproj]
  glsl-parser.lib(parser.obj) : error LNK2019: unresolved external symbol "private: static void __cdecl glsl::astNode<s
truct glsl::astFunction>::operator delete(void *)" (??3?$astNode@UastFunction@glsl@@@glsl@@CAXPEAX@Z) referenced in fun
ction "public: void * __cdecl glsl::astFunction::`scalar deleting destructor'(unsigned int)" (??_GastFunction@glsl@@QEA
APEAXI@Z) [E:\Users\facade\Documents\Github\skybox-painter\build\skyboxpainter.vcxproj]

Is this issue reproducible on any platform other than windows x64? If so, is there any quick fix for it?

@marc-weber1
Copy link
Author

Forgot to post the code that caused the error:

#include "glsl-parser/parser.h"

glsl::parser shader_parser(fShaderCode, fragmentPath);
glsl::astTU *tu = shader_parser.parse(glsl::astTU::kFragment);
std::cout << tu->globals.size() << std::endl;

@zhaocy1217
Copy link

//private:
// void* operator new(size_t);
// void operator delete(void*);
commenting this two lines in ast.h may works.

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

2 participants