glsl-parser
glsl-parser copied to clipboard
parser.h seems to be playing badly with the windows API?
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?
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;
//private: // void* operator new(size_t); // void operator delete(void*); commenting this two lines in ast.h may works.