Closed Pebaz closed 4 years ago
Im using latest Raylib from Github, probably should have specified an exact version in docs. I guess you’re using an older released version?
Oh gotcha (was using 2.0).
I downloaded the prebuild binary of Raylib 2.5 (which strangely is labeled 2.0...) and nearly all of the "undefined externals" went away.
I'm so close but I really don't like to build anything from source on Windows because it never goes well. Once this happens, it should get way easier though for certain tasks but not necessarily for a Windows-specific build. :/
Getting:
_raylib_cffi.obj : error LNK2001: unresolved external symbol TextCountCodepoints
_raylib_cffi.obj : error LNK2001: unresolved external symbol GetNextCodepoint
_raylib_cffi.obj : error LNK2001: unresolved external symbol DrawLineStrip
_raylib_cffi.obj : error LNK2001: unresolved external symbol SetVrConfiguration
_raylib_cffi.obj : error LNK2001: unresolved external symbol DrawTriangleFan
I will give it a go myself as soon as I get windows setup. What do I need to install? I think python expects extensions to be compiled in visual studio 2017 v14 but I’m not sure what packages I need.
I’m also going to try to do more work on the dynamic bindings so compiling won’t be necessary. (Currently they don’t work)
It would definitely be awesome not to have to compile ;)
As for compiling on Windows, I used Visual Studio 2019 (v16.0.1) with Python 3.7.1.
I'm not sure what else you need to do for that, I would install Numpy/Numba or something else that probably requires local compilation in order to test your system before trying out the script.
Also, here is my configuration that worked:
Thanks that is brilliant. I will have a go with VS when I get time. Until then I have included your Windows binary in the pypi release.
I got the dynamic bindings to work, although I'm not sure how because I didnt change anything except recompiling Raylib. Therefore I have split the module into two sub-modules, one for static and one for dynamic.
test_dynamic.py should now work.
However I don't have windows DLLs. Could you compile raylib.dll (or libraylib.dll or whatever its called) for me and put it in raylib/dynamic please?
Sure! I'm taking the RHCSA exam today so I may be able to get to it this evening or tomorrow. Fantastic work on this! Can't wait to actually have textured models in raylib :)
I'm doing it because I've been using Pygame Zero to teach simple 2d game programming, and I wanted a similar library to teach 3d game programming. To that end I've started on the simple API, see test_richlib.py . Will probably split it out into its own project at some point.
For some reason, I simply cannot get a DLL to work.
I ran CMake to generate both the static and dynamic libraries. I don't know what I did wrong but Visual Studio is not generating a DLL that contains the functions.
Never really seen this issue before lol. Do you happen to have a Windows computer you could generate the DLL from?
I tried doing it like this:
cmake SHARED=ON ..
msbuild ALL_BUILDL.vxproj
It built raylib_static.lib and raylib_static.pdb but no DLLs.
How did you build Raylib with VS? The wiki page only has instructions for mingw32.
Thinking ahead... once Raylib 2.5 is officially released we ought to be able to just use the official DLLs.
However, as I've been using it more, I find the dynamic bindings quite annoying. If you make a mistake sometimes you get a segfault and sometimes it just silently doesn't work. The static bindings are better. I think the ideal solution might be to ship static binaries for Windows and Mac and have pip attempt to compile binaries upon install for Linux, because I'm not confident that binaries compiled on one Linux will work on another.
I ran CMake-GUI in the folder. There were 2 different option checkboxes that mentioned "dynamic".
However, I completely agree that we should either wait until Raylib 2.5 comes out or just use static compilation.
I'll ask a few people to test the static compilation soon to get a feel for a couple different people's computers.
Thanks for you help on this, I can't wait to use your port in my projects soon!
Update:
Was able to use the statically-compiled version on different computers just fine (Windows).
Just tested the new release of Raylib v2.5 (DLL) and it worked (Windows)!
I have updated everything to the release version v2.5 and done builds for static, dynamic, python 3.6, python 3.7, windows, mac. only thing I can't get working is any sort of useful static linux build.
Fantastic! What issues are you facing?
First the released libraylib.a isn't compiled with fPIC so cant be linked into a shared library. Then had lots of problems just getting raylib to build. Then built my own libraylib.a with fPIC but couldn't get gcc to include the actual functions in the shared library. Then found that the order of the l flags on the gcc command makes a difference and that cffi builder puts them in the wrong order.
Anyway now it's working, on Ubuntu 18.04 at least (and 16.04 I think) so that is probably the best we can do.
Oh my word, gotta love building C! It surprises me even today how difficult (tedious?) it is to build C/C++ projects. Great job, at least you got it working. You gonna put up a release soon? :)
BTW I'm already using Raylib-Python-CFFI in one of my own projects and once I get a little further into it I'll start converting some of the C Raylib examples after I figure out how to interface with the various components.
This is what I've got so far based off of the Linux/MacOS scripts but it's not building successufully.
Oddly enough, I'm getting "undefined externals for Raylib functions even though it successfully adds the
raylib.lib
...?