symisc/ascii_art

`#ifdev` is causing undefined reference to `main' (I want to use AsciiArtLoadImage)

worthless443 opened this issue · 1 comments

#endif /* STB_IMAGE_IMPLEMENTATION */

^this statement is causing

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status

while I have defined main where I'm trying to use AsciiArtLoadImage, such that

int main() {
     const char* path = "me.bmp";
     int* h; int* w ;
     char* img = AsciiArtLoadImage(path, h, w);
     return 0;
 
 }

can work. Can anyone tell me how this scenario can work?

You need to compile your code with the ART_ENABLE_STB_IMAGE compile-time directive defined, and the ASCII ART Hex model downloaded from https://pixlab.io/art.