hightower2 has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
greenbigfrog has joined #crystal-lang
jhass has quit [Ping timeout: 252 seconds]
straight-shoota has quit [Ping timeout: 260 seconds]
straight-shoota has joined #crystal-lang
jhass has joined #crystal-lang
renich has quit [Quit: Leaving]
<FromGitter>
<Dan-Do> Use the shard crystal_lib or crystal_binding (I dont remember the name exactly) to generate the binding for you.
Scuttlecoil has joined #crystal-lang
Chillfox has quit [Ping timeout: 240 seconds]
<FromGitter>
<azurelmao> > For now you can use this as a tool to generate bindings from a lib declaration. ⏎ A lib declaration is something like this? ⏎ ⏎ ```@[Link("pcre")] ⏎ lib LibPCRE ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=639edb8689c38775e768a68c]
<FromGitter>
<azurelmao> But I'm not sure what to put inside `Link` because that spng lib isn't really something you can install
<FromGitter>
<azurelmao> in C you just put it in your project
<FromGitter>
<azurelmao> so how do I include the .c and .h files locally within my project?
<FromGitter>
<azurelmao> @Dan-Do
<FromGitter>
<naqvis> `Link` annotation is to define the dynamic library which need to be linked at link time. You have two options here, either compile `libspng` as a shared module and use that in `Link` annotation, another option would be to compile `libspng` as a static library and do a static linking at compile time.
<FromGitter>
<naqvis> Choice is yours. Either you have your shard users, download and compile the `libspng` as dynamic library, or you provide the scripts with your shard and perform compilation of C files and linkage with crystal
<FromGitter>
<naqvis> Remember, Crystal doesn't deal with compilation of C or other foreign languages, all it provides is a mechanism to integrate external libraries via FFI
<FromGitter>
<naqvis> so refer to documentation of `libspng` on how to proceed with compilation
<FromGitter>
<azurelmao> Well, I want my shard users to not have to do anything
<FromGitter>
<azurelmao> run the executable and everything works out of the box
alexherbo2 has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter>
<azurelmao> @Dan-Do crystal_lib doesn't work
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<FromGitter>
<azurelmao> I've been working on manually binding to the lib
<FromGitter>
<azurelmao> but I got an idea
<FromGitter>
<azurelmao> couldn't I just write a function in a C program that calls certain functions from that lib and returns the finished image data?
<FromGitter>
<azurelmao> then I could just bind to that one self written function
<FromGitter>
<azurelmao> i think that's what i'll prolly do
taupiqueur has quit [Ping timeout: 264 seconds]
alexherbo2 has quit [Ping timeout: 260 seconds]
taupiqueur has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<FromGitter>
<oprypin:matrix.org> @azurelmao: no that's the harder way