SaptakBhoumik / Peregrine

A blazing fast language for the blazing fast world(WIP)
https://peregrine-lang.github.io/
Mozilla Public License 2.0
1.46k stars 76 forks source link

including external c libraries #103

Closed alfie-nsugh closed 3 years ago

alfie-nsugh commented 3 years ago

Is your feature request related to a problem? Please describe. I wanted to use Peregrine instead of C to write sdl2 code, but I could not find a way to include libraries I tried to when compiling to add the -lSDL2 and the -lSDL2_image flag but that didn't work, so I thought that would be a nice feature to include.

Describe the solution you'd like I would like to have in the peregrine compiler to have the option to include external libraries like SDL2 and SDL2_image and SDL2_ttf

Describe alternatives you've considered I honestly don't know of any other alternative methods outside of allowing -l flags

Additional context Add any other context or screenshots about the feature request here. afbeelding This was what I wanted to compile which I compiled using: ~/Peregrine/Peregrine/peregrine compile test.pe -lSDL2 -lSDL2_image -o test

SaptakBhoumik commented 3 years ago

@alfie-nsugh This language is very young so you cant do it. If you still want to do it somehow then run the following command ~/Peregrine/Peregrine/peregrine compile test.pe -emit-c Then compile the c code generated using the following command gcc temp.c -lSDL2 -lSDL2_image -o test

alfie-nsugh commented 3 years ago

That works thanks!