compile error occurs with opengl functions in webassembly env.
-
When I compile following OpenGL source, it worked well
on MS Windows 10 desktop.
But compile error occured in webassembly compilation environment
like below in Ubuntu. I can't figure out what's wrong.It's Qt 5.13.0 which compiled the source with wasm.
The OS is Ubuntu 18.04.2.
widget.cpp:68:5: error: use of undeclared identifier 'glColor3f'
glColor3f(1.0f, 0.0f, 0.0f);
^
widget.cpp:70:5: error: use of undeclared identifier 'glBegin'
glBegin(GL_LINE_STRIP);
^
widget.cpp:71:5: error: use of undeclared identifier 'glVertex3f'
glVertex3f(-0.5f, 0.5f, 0);
^
widget.cpp:72:5: error: use of undeclared identifier 'glVertex3f'
glVertex3f(0.5f, 0.5f, 0);
^
widget.cpp:73:5: error: use of undeclared identifier 'glVertex3f'
glVertex3f(0.5f, -0.5f, 0);
^
widget.cpp:74:5: error: use of undeclared identifier 'glVertex3f'
glVertex3f(-0.5f, -0.5f, 0);
^
widget.cpp:75:5: error: use of undeclared identifier 'glEnd'
glEnd();
^
widget.cpp:77:5: error: use of undeclared identifier 'glEnd'
glEnd();
glClearColor(0.2f, 0.3f, 0.3f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0f, 0.0f, 0.0f); glBegin(GL_LINE_STRIP); glVertex3f(-0.5f, 0.5f, 0); glVertex3f(0.5f, 0.5f, 0); glVertex3f(0.5f, -0.5f, 0); glVertex3f(-0.5f, -0.5f, 0); glEnd(); glEnd(); glFlush();
-
Hi and welcome to the forums
Did you install the dev lib ?
sudo apt-get install libgl-dev