Hi everyone.
I'm trying to add a library to the Love2D source code. (The main goal is to expose it as a module on lua). In Windows it was easy using vcpkg, just #include'ing the library compiled and worked.
However in Ubuntu the compilation throw errors, as it is not finding the library functions. In gcc I would use the flag -llibname to make it know about the library. It seems I would need to edit the CMakeList.txt file, however I'm a total noob on cmake.
How could I do that?
Thanks in advance!
How to add a C library in linux?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: How to add a C library in linux?
Do you need to modify löve itself though? Can you not just require in the c library?
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: How to add a C library in linux?
You mean, like in this tutorial? I guess so. I thought it would be faster to have the code directly in the executable. The library contains functions specific to a hardware platform.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: How to add a C library in linux?
There won't be a difference, performance-wise. It generally takes more effort to modify love instead of having a standalone library, so the former is slower to implement.
If runtime performance is really important, you'd probably want to use LuaJIT's FFI to call C functions that are in your standalone library instead of creating C bindings with stock Lua's C API. It will be a lot faster when the surrounding code is able to be JIT-compiled.
If runtime performance is really important, you'd probably want to use LuaJIT's FFI to call C functions that are in your standalone library instead of creating C bindings with stock Lua's C API. It will be a lot faster when the surrounding code is able to be JIT-compiled.
Who is online
Users browsing this forum: Semrush [Bot] and 6 guests