termbox2 icon indicating copy to clipboard operation
termbox2 copied to clipboard

Releases

Open jirutka opened this issue 2 years ago • 9 comments

Can you please start making releases? To be more specific, tagging versions in git and setting SONAME. This would greatly help packaging in Linux distributions.

jirutka avatar Aug 01 '22 01:08 jirutka

this is a header-only library so there's no .so and packaging doesn't make sense either. whoever uses it is supposed to copy the header into his source tree and bake the code into a translation unit of his choice.

rofl0r avatar Aug 01 '22 12:08 rofl0r

README.md:

How to use termbox2 As mentioned above, there are two options: ... 2. Build termbox2 as a library (either make libtermbox.so or make libtermbox.a) and link as normal.

jirutka avatar Aug 01 '22 12:08 jirutka

See #40

adsr avatar Aug 02 '22 02:08 adsr

I dont think this is feasible as long as compile time options like truecolor and egc exist

git-bruh avatar Aug 02 '22 08:08 git-bruh

I dont think this is feasible as long as compile time options like truecolor and egc exist

Can you please elaborate?

jirutka avatar Aug 03 '22 22:08 jirutka

termbox2 can be used a library. The tests run as such. I think what git-bruh may mean is that compile-time options of the library can mismatch include-time options of the calling program. For example, if the library is compiled with EGC and the calling program does not define that option before including termbox.h, at best certain functions will not work as expected, at worst you will segfault. This is because TB_OPT_EGC and TB_OPT_TRUECOLOR influence how certain types are defined.

I've added some guards against this in f0ba92634b4d45222b7638addb837b04e6841bba. The library is compiled with TB_LIB_OPTS which hard-codes a liberal set of options (both EGC and truecolor enabled). The makefile autogenerates termbox.h.lib by flipping a single #if 0 to an #if 1 which has the same effect as defining TB_LIB_OPTS. Packagers should make lib && make install_lib which will install the libraries plus termbox.h.lib (as termbox.h) to ensure consistency.

adsr avatar Aug 04 '22 05:08 adsr

I think termbox2 can work with C++, but when I build it, many errors print out like this:

$ g++ test.cpp -o test
In file included from test.cpp:2:
termbox.h: In function ‘int cap_trie_add(const char*, uint16_t, uint8_t)’:
termbox.h:1962:27: error: invalid conversion from ‘void*’ to ‘cap_trie_t*’ [-fpermissive]
 1962 |                 tb_realloc(node->children, sizeof(*node) * node->nchildren);
      |                           ^
      |                           |
      |                           void*
termbox.h: In function ‘int update_term_size_via_esc()’:
termbox.h:2102:29: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
 2102 |     char *move_and_report = "\x1b[9999;9999H\x1b[6n";
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~

The test.cpp is just the source code of this project's reamdme.md's synopsis

Thanks.

krishna116 avatar Aug 10 '22 02:08 krishna116

The code guarded by TB_IMPL is C code only and has to be compiled in a seperate file and linked with main code, only the header code has c++ compatibility

git-bruh avatar Aug 10 '22 11:08 git-bruh

Got it, thank you.

krishna116 avatar Aug 11 '22 23:08 krishna116

https://github.com/termbox/termbox2/releases/tag/v2.0.0

adsr avatar Sep 18 '22 19:09 adsr