emscripten-core / emscripten-core/emscripten

USE_REGAL does not link in GLU methods

Open
#15,139 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I'm using Regal (for OpenGL 1 emulation) and SDL 1. I'm not pulling in GLU, even with the flags I would expect would work.

Flags:
```
CFLAGS := -s USE_REGAL=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0
LDFLAGS := -s USE_REGAL=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -lGL -lGLU
```

Output:
```
warning: undefined symbol: SDL_GetRelativeMouseState (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluBuild2DMipmaps (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluDeleteQuadric (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluLookAt (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluNewQuadric (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluPerspective (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluQuadricNormals (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluQuadricTexture (referenced by top-level compiled C/C++ code)
warning: undefined symbol: gluSphere (referenced by top-level compiled C/C++ code)
```

Without the `ERROR_ON_UNDEFINED_SYMBOLS`, there's obviously linking errors. With it, there's run-time exceptions thrown in the browser complaining about the missing symbols...

Is there anything I can do short of compiling and linking in a GLU library implementation myself, such as `quad.c`, etc. from Mesa? I can probably work around the missing `SDL_GetRelativeMouseState` as well just by subtracting absolute mouse state between frames, would be nice to have the original method though...

Nonetheless, I would have expected all of these to be included with emscripten with the above options. Can you please check to make sure I am not doing anything wrong?

Thanks a bunch for your help!!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.