openframeworks / openframeworks/openFrameworks

Build failure with clang-4.0: can't find glfwSetKeyCallback

Open
#5,796 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

It can't find this function in glfw-3.2.1 (the latest version) due to int/unsigned conflict:

/usr/ports/devel/openframeworks/work/openFrameworks-0.9.8/libs/openFrameworks/app/ofAppGLFWWindow.cpp:301:2: error: no matching function for call to 'glfwSetKeyCallback'
        glfwSetKeyCallback(windowP, keyboard_cb);
        ^~~~~~~~~~~~~~~~~~
/usr/local/include/GLFW/glfw3.h:3307:20: note: candidate function not viable: no known conversion from 'void (GLFWwindow *, int, int, unsigned int, int, int)' to 'GLFWkeyfun'
      (aka 'void (*)(GLFWwindow *, int, int, int, int)') for 2nd argument
GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
                   ^

openframeworks-0.9.8 on FreeBSD-11.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at libs/openFrameworks/app/ofAppGLFWWindow.cpp:301 and compare the keyboard callback passed to glfwSetKeyCallback with the GLFWkeyfun declaration in /usr/local/include/GLFW/glfw3.h. Reproduce the openFrameworks 0.9.8 build on FreeBSD 11.1 with clang-4.0; done means the project compiles without this callback type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.