Comments (4)
I see. It's a really silly bug in the implementation. I'll have a fix committed in a day or two.
from bindbc-glfw.
loadedGLFWVersion returns the highest version requested, not the highest version successfully loaded. Is that right?
No. loadedGLFWVersion
should return the highest version that loaded. If the load errors occur during, say, loading 3.2, then the loaded version will report as 3.1.
from bindbc-glfw.
I'm seeing loadedGLFWVersion
return glfw33
after loadGLFW
returned badLibrary
due to me compiling with GLFW_33
but only having /usr/lib/x86_64-linux-gnu/libglfw.so.3.2
installed on the target system.
In this scenario, I would have expected loadedGLFWVersion
to return glfw32
since the symbols up to there loaded cleanly, and that way my application can just decide at runtime to skip all the calls that would use GLFW 3.3.
I removed my application-specific code & produced a minimal example:
// app.d
module main;
import std.stdio;
import bindbc.glfw;
import bindbc.loader.sharedlib;
void main()
{
writeln(glfwSupport);
writeln(loadGLFW());
writeln(isGLFWLoaded());
writeln(loadedGLFWVersion());
foreach( const ErrorInfo err ; errors() )
writeln( err.error()[ 0 .. 32 ] ,` ` ,err.message()[ 0 .. 96 ] );
}
And here's info about the system that is compiling & running the code:
$ find /usr/local/lib/ -type f -a -iname 'libglfw*' 2>/dev/null
$ find / -type f -a -iname 'libglfw*' 2>/dev/null
/usr/lib/x86_64-linux-gnu/libglfw.so.3.2
/var/lib/dpkg/info/libglfw3-dev:amd64.list
/var/lib/dpkg/info/libglfw3-doc.md5sums
/var/lib/dpkg/info/libglfw3-dev:amd64.md5sums
/var/lib/dpkg/info/libglfw3:amd64.list
/var/lib/dpkg/info/libglfw3:amd64.triggers
/var/lib/dpkg/info/libglfw3:amd64.md5sums
/var/lib/dpkg/info/libglfw3:amd64.symbols
/var/lib/dpkg/info/libglfw3:amd64.shlibs
/var/lib/dpkg/info/libglfw3-doc.list
/var/cache/apt/archives/libglfw3-doc_3.2.1-1_all.deb
/var/cache/apt/archives/libglfw3_3.2.1-1_amd64.deb
/var/cache/apt/archives/libglfw3-dev_3.2.1-1_amd64.deb
$ ls -1 ~/.dub/packages/
bindbc-glfw-0.6.0
bindbc-loader-0.2.1
$ dmd --version
DMD64 D Compiler v2.087.1
Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved written by Walter Bright
Here's a dub.json
that compiles with GLFW_33
:
{"name":"test","targetType":"executable","versions":["GLFW_33"],"dependencies":{"bindbc-glfw":"~>0.6"},"libs":["glfw3"]}
And here's the output from dub run
with those files:
$ dub run
Performing "debug" build using /usr/bin/dmd for x86_64.
bindbc-loader 0.2.1: building configuration "noBC"...
bindbc-glfw 0.6.0: building configuration "dynamic"...
test ~master: building configuration "application"...
Linking...
glfw33
badLibrary
true
glfw33
libglfw3.so�y0E��9`0E��9` libglfw3.so: cannot open shared object file: No such file or directory
Missing Symbol� glfwInitHint
Missing Symbol�G��9`@E��9` glfwGetError
Missing Symbol�� glfwGetMonitorWorkarea
Missing Symbol�K��9`�G��9` glfwGetMonitorContentScale
Missing Symbol glfwSetMonitorUserPointer
Missing Symbol glfwGetMonitorUserPointer
Missing Symbol� glfwWindowHintString
Missing SymbolX[K��yX[K��y glfwGetWindowContentScale
Missing Symbol�� glfwGetWindowOpacity
Missing Symbol glfwSetWindowOpacity
Missing Symbol glfwRequestWindowAttention
Missing Symbol�I��9`�E��9` glfwSetWindowAttrib
Missing Symbol�E��9` glfwSetWindowMaximizeCallback
Missing Symbol�H��9` glfwSetWindowContentScaleCallback
Missing Symbol glfwGetKeyScancode
Missing Symbol glfwUpdateGamepadMappings
Missing Symbol glfwGetGamepadName
Missing Symbol glfwGetGamepadState
Compiling without GLFW_33
works as expected, but only loads glfw30
. So to have my application take the newest version of GLFW it can find, I assume I have to compile with the version
for the highest version of GLFW supported by bindbc-glfw. Is that right?
Also, I know I'm probably printing out the errors incorrectly since garbage is appearing in the output. Sorry, haven't had time to look at that part of things.
from bindbc-glfw.
@shofixti-scout Sorry for the delay. The issue is resolved in version 0.7.0. It now correctly reports the version that successfully loaded.
from bindbc-glfw.
Related Issues (8)
- Error: undefined identifier: isGLFWLoaded HOT 2
- attributes for bindbc-glfw functions HOT 2
- Vulkan + GLFW dynamic binding HOT 6
- undefined identifier loadGLFW, when using BindGLFW_Static HOT 7
- non-@nogc function pointer types HOT 3
- bindGLFW_WGL Error: cannot return non-void from `void` function HOT 6
- With DMD there is a compiler error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bindbc-glfw.