Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

all demos and examples fail in Ubuntu 14.04.3 32 #32

Closed
trappedinspacetime opened this issue Dec 29, 2015 · 7 comments
Closed

all demos and examples fail in Ubuntu 14.04.3 32 #32

trappedinspacetime opened this issue Dec 29, 2015 · 7 comments

Comments

@trappedinspacetime
Copy link

Hi,
First of all I congratulate you on your innovative work. While I was looking for a gui toolkit apart from gtk, I found your project. I am impressed with the introductory animations. I wanted to try it.

I downloaded the zip package and exracted it in ~/Downloads folder. I navigated to ../zahnrad-master/demo/linuxgl and opened command prompt and run make

Here is the output

   kenn@kenn:~/Downloads/zahnrad-master/zahnrad-master/demo/linuxgl$ make 
 rm -f bin/zahnrad 
 gcc linuxgl.c ../../zahnrad.c -std=c89 -pedantic -O2 -o bin/zahnrad -lX11 -lm -lGL -lm -lGLU
 In file included from linuxgl.c:31:0:
 ../demo.c: In function ‘show_test_window’:
 ../demo.c:145:17: warning: passing argument 2 of ‘zr_progress’ from incompatible pointer type [enabled by default]
                  zr_progress(&menu, &prog, 100, ZR_MODIFIABLE);
                  ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2894:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_progress(struct zr_context*, zr_size *cur, zr_size max, int modifyable);
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:292:9: warning: passing argument 2 of ‘zr_progress’ from incompatible pointer type [enabled by default]
          zr_progress(&menu, &prog, 100, ZR_MODIFIABLE);
          ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2894:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_progress(struct zr_context*, zr_size *cur, zr_size max, int modifyable);
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:480:13: warning: passing argument 2 of ‘zr_progress’ from incompatible pointer type [enabled by default]
              zr_progress(&layout, &prog_value, 100, ZR_MODIFIABLE);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2894:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_progress(struct zr_context*, zr_size *cur, zr_size max, int modifyable);
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:582:13: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat=]
              sprintf(buffer, "%lu", sum);
              ^
 ../demo.c:586:17: warning: passing argument 2 of ‘zr_progress’ from incompatible pointer type [enabled by default]
                  zr_progress(&combo, &x, 100, ZR_MODIFIABLE);
                  ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2894:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_progress(struct zr_context*, zr_size *cur, zr_size max, int modifyable);
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:587:17: warning: passing argument 2 of ‘zr_progress’ from incompatible pointer type [enabled by default]
                  zr_progress(&combo, &y, 100, ZR_MODIFIABLE);
                  ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2894:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_progress(struct zr_context*, zr_size *cur, zr_size max, int modifyable);
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:588:17: warning: passing argument 2 of ‘zr_progress’ from incompatible pointer type [enabled by default]
                  zr_progress(&combo, &z, 100, ZR_MODIFIABLE);
                  ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2894:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_progress(struct zr_context*, zr_size *cur, zr_size max, int modifyable);
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:589:17: warning: passing argument 2 of ‘zr_progress’ from incompatible pointer type [enabled by default]
                  zr_progress(&combo, &w, 100, ZR_MODIFIABLE);
                  ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2894:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_progress(struct zr_context*, zr_size *cur, zr_size max, int modifyable);
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:595:13: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ [-Wformat=]
              sprintf(buffer, "%lu", sum);
              ^
 ../demo.c:644:27: warning: assignment from incompatible pointer type [enabled by default]
                  clip.copy = copy_callback;
                            ^
 ../demo.c:652:13: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[0], &text_len[0], 64, &text_active[0], &text_cursor[0], ZR_INPUT_DEFAULT);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:652:13: warning: passing argument 6 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[0], &text_len[0], 64, &text_active[0], &text_cursor[0], ZR_INPUT_DEFAULT);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:654:13: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[1], &text_len[1], 64, &text_active[1], &text_cursor[1], ZR_INPUT_DEC);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:654:13: warning: passing argument 6 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[1], &text_len[1], 64, &text_active[1], &text_cursor[1], ZR_INPUT_DEC);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:656:13: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[2], &text_len[2], 64, &text_active[2], &text_cursor[2], ZR_INPUT_FLOAT);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:656:13: warning: passing argument 6 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[2], &text_len[2], 64, &text_active[2], &text_cursor[2], ZR_INPUT_FLOAT);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:658:13: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[4], &text_len[4], 64, &text_active[4], &text_cursor[4], ZR_INPUT_HEX);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:658:13: warning: passing argument 6 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[4], &text_len[4], 64, &text_active[4], &text_cursor[4], ZR_INPUT_HEX);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:660:13: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[5], &text_len[5], 64, &text_active[5], &text_cursor[5], ZR_INPUT_OCT);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:660:13: warning: passing argument 6 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[5], &text_len[5], 64, &text_active[5], &text_cursor[5], ZR_INPUT_OCT);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:662:13: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[6], &text_len[6], 64, &text_active[6], &text_cursor[6], ZR_INPUT_BIN);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:662:13: warning: passing argument 6 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[6], &text_len[6], 64, &text_active[6], &text_cursor[6], ZR_INPUT_BIN);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:672:17: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
                  zr_edit(&layout, buffer, &text_len[8], 64, &text_active[8], NULL, ZR_INPUT_DEFAULT);
                  ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:682:13: warning: passing argument 3 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[7], &text_len[7], 64, &text_active[7], &text_cursor[7], ZR_INPUT_ASCII);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 In file included from linuxgl.c:31:0:
 ../demo.c:682:13: warning: passing argument 6 of ‘zr_edit’ from incompatible pointer type [enabled by default]
              zr_edit(&layout, text[7], &text_len[7], 64, &text_active[7], &text_cursor[7], ZR_INPUT_ASCII);
              ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:2908:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_edit(struct zr_context*, char *buffer, zr_size *len, zr_size max,
       ^
 linuxgl.c: In function ‘font_bake_and_upload’:
 linuxgl.c:384:9: warning: passing argument 1 of ‘zr_font_bake_memory’ from incompatible pointer type [enabled by default]
          zr_font_bake_memory(&tmp_size, &glyph_count, &config, 1);
          ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:1513:6: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  void zr_font_bake_memory(zr_size *temporary_memory, int *glyph_count,
       ^
 linuxgl.c:390:9: warning: passing argument 1 of ‘zr_font_bake_pack’ from incompatible pointer type [enabled by default]
          if (!zr_font_bake_pack(&img_size, &img_width,&img_height,&custom,tmp,tmp_size,&config, 1))
          ^
 In file included from linuxgl.c:24:0:
 ../../zahnrad.h:1523:5: note: expected ‘zr_size *’ but argument is of type ‘size_t *’
  int zr_font_bake_pack(zr_size *img_memory, int *img_width, int *img_height,
      ^
 linuxgl.c: In function ‘main’:
 linuxgl.c:845:17: warning: assignment from incompatible pointer type [enabled by default]
      alloc.alloc = mem_alloc;
                  ^
 linuxgl.c: In function ‘file_load’:
 linuxgl.c:206:10: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
      fread(buf, *siz, 1, fd);
           ^
 ../../zahnrad.c:110:13: error: size of array ‘zr__check_size’ is negative
  typedef int zr__check_size[(sizeof(void*) == sizeof(zr_size)) ? 1 : -1];
              ^
 ../../zahnrad.c: In function ‘zr_hash’:
 ../../zahnrad.c:514:5: warning: integer constant is too large for ‘unsigned long’ type [-Wlong-long]
      const zr_ulong m = 0xc6a4a7935bd1e995UL;
      ^
 In file included from ../../zahnrad.c:3278:0:
 ../../stb_truetype.h: In function ‘stbtt__rasterize_sorted_edges’:
 ../../stb_truetype.h:2048:4: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
     stbtt__hheap hh = { 0 };
     ^
 ../../zahnrad.c: In function ‘zr_begin’:
 ../../zahnrad.c:92:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  #define ZR_OFFSETOF(st, m) ((zr_size)(&((st *)0)->m))
                              ^
 ../../zahnrad.c:94:56: note: in expansion of macro ‘ZR_OFFSETOF’
      ((const type*)((const void*)((const zr_byte*)ptr - ZR_OFFSETOF(type, member))))
                                                         ^
 ../../zahnrad.c:6557:27: note: in expansion of macro ‘ZR_CONTAINER_OF_CONST’
                      cur = ZR_CONTAINER_OF_CONST(iter, struct zr_window, buffer);
                            ^
 make: *** [zahnrad] Error 1

I hope you help me work it.

Regards.

Kenn

@dumblob
Copy link
Contributor

dumblob commented Dec 29, 2015

Please note, that a week ago a note CURRENTLY UNDER HEAVY REFACTORING! (do not use at the moment) was added to the top of the Readme.md file.

Feel free to use the version from 15. 12. 2015 (i.e. before the major refactoring has begun), which should work with all the demos and examples flawlessly.

@trappedinspacetime
Copy link
Author

@dumblob Thank you for the info. After I cloned the repo then cd zahnrad directory in my local disk then git reset --hard 9c3365e1abb1be4a826210acf92e6dce7fba2173 did the trick. Examples compile fine in that commit, but when I attempt to run the binary I get Missing TTF Font file argument: demo <path> error. However when I run it ./rahnrad --help command example runs and gui opens but screen gets extremely slow. One of the examples gave me unsported opengl 2.0 graphic card error. My computer rather old, may slowness be related to my graphic card?

@dumblob
Copy link
Contributor

dumblob commented Dec 29, 2015

Regarding missing TTF font file, please use some of the bundled fonts (https://github.com/vurtun/zahnrad/tree/master/font).

Zahnrad is rendering-backend-agnostic and demos use different rendering backends to show how to use some of the well-known backends from various platforms (glfw, linuxgl, nanovg, sdl, win32, x11, ...).

Could you please tell us which backend did you use, so that we could look into the slowness? This library fits also embedded slow systems, so there should be no issue with speed (actually, I would guess, that you're running OpenGL demos/examples, but all the computations are performed by CPU as your graphic card doesn't support newer OpenGL specifications).

@vurtun
Copy link
Owner

vurtun commented Dec 29, 2015

Hey,
sorry for the not working examples/demos but I uploaded the complete changes even though I only wanted to upload the updated Readme and since I wrote a notice did not fix it. Was a big mistake on my part and something a learned from, but the new version will be uploaded in the next few days (definitely this week). I was able to simplify the API a lot but the new version will break almost everything so please don't start using this library until the new version.

Missing TTF Font file

Please call all demo/example programs with one of the .ttf files found inside the /font folder as an argument. Currently I do not have a default font inside the library only provide a way to bake one or use existing font handling so you have to provide a TTF-Font for them to work.

One of the examples gave me unsported opengl 2.0 graphic card error

You probably tried to run the linuxgl demo which requires at least OpenGL 2.0 with a number of extensions or OpenGL 3.0. If you have Linux please try the x11 demo which is guaranteed to work and does not need a TTF-Font to work.

@trappedinspacetime
Copy link
Author

Thank you guys for responding, you are very helpful.

@vurtun Thanks for the info. I understand that your project is under development, it's OK. Luckily you and @dumblob directed me on the right path, and I could test your demos. I could run X11 demo, it runs smooth, no slowness. It looks fantastic! If only I could code like you.

@dumblob Only X11 example runs well. The rest of it very slow despite I add the font argument. For example the one in /zahnrad/example/demo/bin I ran it like ./demo ../../../font/DroidSans.ttf gui opens but very slow.

@vurtun
Copy link
Owner

vurtun commented Dec 30, 2015

The rest of it very slow despite I add the font argument

The /example/demo/ is slow since it uses NanoVG which is not really meant for this kind of GUI, at least the default OpenGL implementation of it and for older PCs. The only reason why I use it is because it is easy to load images and fonts with NanoVG and I can test out more advanced things more quickly while still having a nice looking UI. In theory everything could be done in X11 (even if the image handling with xlib is crappy) or Win32 (ugly as hell) but I would loose portability.

@trappedinspacetime
Copy link
Author

@vurtun Thank you for the info. You provided a range of demos. I have to be content with X11 demo. I wish you determination in your project. I hope you come up with a gui designer in the future.
Happy new year.

@vurtun vurtun closed this as completed Jan 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants