#1 Header style library

Zamknięty
otworzone 2 lat temu przez acetone · 7 komentarzy
acetone skomentował 2 lat temu

Hi. Can you turn library to headers-only style or explain me how I can do this shortly? I trying do this one hour and now go crazy with much C errors and infinity streams of undefined :)

I want use this cute library like a header in C++ projects.

Hi. Can you turn library to headers-only style or explain me how I can do this shortly? I trying do this one hour and now go crazy with much C errors and infinity streams of `undefined` :) I want use this cute library like a header in C++ projects.
g0tsu skomentował 2 lat temu
Właściciel

Hi !

Yeah, it is not a trivial task. Please check out the make-singleh.sh script which creates a huge libcaptcha.h.

Thanks.

Hi ! Yeah, it is not a trivial task. Please check out the `make-singleh.sh` script which creates a huge `libcaptcha.h`. Thanks.
acetone skomentował 2 lat temu
Autor

Thanks for answer, lets try!

make-singleh.sh push the error: headers.h not found (line 45)

If I remove this name from file and start script again, I see many error like this:

../libcaptcha.h:3694:51: error: ‘o1’ undeclared (first use in this function); did you mean ‘y1’?
          _mm_storeu_si128((__m128i *) (out + 16), o1);
                                                   ^~
                                                   y1
In file included from example1.c:2:
../libcaptcha.h: In function ‘lc_randomize_arr_rotation’:
../libcaptcha.h:18424:5: warning: ‘lc_rotate_glyph’ is deprecated [-Wdeprecated-declarations]
     narr->items[i] = lc_rotate_glyph(arr->items[i], angle);
     ^~~~
../libcaptcha.h:17546:15: note: declared here
 lc_bmpGlyph * lc_rotate_glyph(lc_bmpGlyph *glyph, int angle);
               ^~~~~~~~~~~~~~~

What shoud I do, master? :)

Thanks for answer, lets try! make-singleh.sh push the error: `headers.h` not found (line 45) If I remove this name from file and start script again, I see many error like this: ``` ../libcaptcha.h:3694:51: error: ‘o1’ undeclared (first use in this function); did you mean ‘y1’? _mm_storeu_si128((__m128i *) (out + 16), o1); ^~ y1 In file included from example1.c:2: ../libcaptcha.h: In function ‘lc_randomize_arr_rotation’: ../libcaptcha.h:18424:5: warning: ‘lc_rotate_glyph’ is deprecated [-Wdeprecated-declarations] narr->items[i] = lc_rotate_glyph(arr->items[i], angle); ^~~~ ../libcaptcha.h:17546:15: note: declared here lc_bmpGlyph * lc_rotate_glyph(lc_bmpGlyph *glyph, int angle); ^~~~~~~~~~~~~~~ ``` What shoud I do, master? :)
g0tsu skomentował 2 lat temu
Właściciel

You're right. It is my fault, I've forgottent to remove the headers.h from the script (it was kinda home for all of those #includes before I moved them into the script). Sorry for this.

The changes:

95bcc8d0d3

You're right. It is my fault, I've forgottent to remove the `headers.h` from the script (it was kinda home for all of those `#includes` before I moved them into the script). Sorry for this. The changes: https://notabug.org/g0tsu/libcaptcha/commit/95bcc8d0d3e565fd7e003cbe1ec4e4c572598658
acetone skomentował 2 lat temu
Autor

Thanks. Now a have many errors with undefined types at final step:

cc example1.c -I../ -lm -o shtest

Error like this:

./libcaptcha.h: In function ‘stbi__idct_simd’:
../libcaptcha.h:2503:4: error: unknown type name ‘__m128i’; did you mean ‘__int128’?
    __m128i row0, row1, row2, row3, row4, row5, row6, row7;
    ^~~~~~~
    __int128
../libcaptcha.h:2504:4: error: unknown type name ‘__m128i’; did you mean ‘__int128’?
    __m128i tmp;
    ^~~~~~~
    __int128

Full output: https://paste.i2pd.xyz/?8b9bef12a860db83#8mVBwUnedF2JJPn7ZCg5NYtYKa5fRKu8nTH2Cjgw9PuG

I googling somethink like that, but not understand what should I do)

Thanks. Now a have many errors with undefined types at final step: ```bash cc example1.c -I../ -lm -o shtest ``` Error like this: ```bash ./libcaptcha.h: In function ‘stbi__idct_simd’: ../libcaptcha.h:2503:4: error: unknown type name ‘__m128i’; did you mean ‘__int128’? __m128i row0, row1, row2, row3, row4, row5, row6, row7; ^~~~~~~ __int128 ../libcaptcha.h:2504:4: error: unknown type name ‘__m128i’; did you mean ‘__int128’? __m128i tmp; ^~~~~~~ __int128 ``` Full output: https://paste.i2pd.xyz/?8b9bef12a860db83#8mVBwUnedF2JJPn7ZCg5NYtYKa5fRKu8nTH2Cjgw9PuG I googling somethink like [that](https://stackoverflow.com/questions/11571514/strange-error-during-cast-to-m128i), but not understand what should I do)
g0tsu skomentował 2 lat temu
Właściciel

Yeah, looks like missing emmintrin.h , will add a bit later, but you can do it manually.

Yeah, looks like missing `emmintrin.h` , will add a bit later, but you can do it manually.
acetone skomentował 2 lat temu
Autor

Oh thanks! You can merge it: https://notabug.org/g0tsu/libcaptcha/pulls/2

Let me try compile some example file...

Fine. It's compiled. In begin I have bit issue because forget -lm flag :)

Oh thanks! You can merge it: https://notabug.org/g0tsu/libcaptcha/pulls/2 Let me try compile some example file... Fine. It's compiled. In begin I have bit issue because forget `-lm` flag :)
acetone skomentował 2 lat temu
Autor

Thank you so much for fast response, man!

Thank you so much for fast response, man!
Zaloguj się, aby dołączyć do tej rozmowy.
Brak etykiety
Brak kamienia milowego
Brak przypisania
2 uczestników
Ładowanie...
Anuluj
Zapisz
Nie ma jeszcze treści.