E0003: PShader needs to be a pointer

Compiler Error

What it means

A PShader holds onto a compiled program running on the graphics card. Copying isn't allowed for the same reason as PGraphics and PImage.

How to fix it

Use PShader* instead of PShader.

Example

Before
PShader shader; shader = loadShader("frag.glsl"); shader(shader);
After
PShader* shader; shader = loadShader("frag.glsl"); shader(shader);

Notes

Use -> for calling methods on the shader itself, like shader->set(...).