Skip to content
Discussion options

You must be logged in to vote

For the first, although GLFW is written in C, it's meant to be usable from C++; c_include is only for pure C libraries that have no such provision.

For the second, yes that function requires arguments, no way around that. You can not pass Python integers as you need a C++ int-sized patch of memory each for the function to scribble in and the Python int internals don't look anything like that. Easiest would be the use of ctypes:

>>> from ctypes import c_int
>>> major, minor, rev = c_int(0), c_int(0), c_int(0)
>>> cppyy.gbl.glfwGetVersion(major, minor, rev)
>>> print(major, minor, rev)
c_int(3) c_int(3) c_int(2)

Or if you use numpy already and are okay with that as a dependency:

>>> import…

Replies: 5 comments 11 replies

Comment options

You must be logged in to vote
5 replies
@tribals
Comment options

@wlav
Comment options

wlav Nov 21, 2025
Maintainer

@tribals
Comment options

@wlav
Comment options

wlav Nov 21, 2025
Maintainer

@tribals
Comment options

Answer selected by tribals
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@wlav
Comment options

wlav Nov 21, 2025
Maintainer

@tribals
Comment options

@wlav
Comment options

wlav Nov 22, 2025
Maintainer

@tribals
Comment options

@tribals
Comment options

Comment options

You must be logged in to vote
1 reply
@tribals
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants