lh3/hickit

compiling error

zhang-jiankun opened this issue · 5 comments

I have errors in compiling hickit (make gl=1).

pair.c: In function ‘hk_pair2loop’:
 pair.c:488:49: warning: variable ‘best_j’ set but not used [-Wunused-but-set-variable]
  int j, d = hk_ppos2(p) - hk_ppos1(p), best_k, best_j;

bin.c: In function ‘hk_bmap_gen’:
bin.c:142:10: warning: variable ‘n_del’ set but not used [-Wunused-but-set-variable]
  int32_t n_del, m_pairs = 0;

fdg.c: In function ‘hk_fdg’:
fdg.c:368:6: warning: argument 1 range [18446744071562067968, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  tmp = CALLOC(int32_t, m->n_pairs);
In file included from fdg.c:1:0:

/usr/include/stdlib.h:541:14: note: in a call to allocation function ‘calloc’ declared here
 extern void *calloc (size_t __nmemb, size_t __size)
view3d.c:32:3: warning: non-local variable ‘global’ with anonymous type is questionable in C++ [-Wc++-compat]
 } global;

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libglut.a(libglut_la-freeglut_state.o): undefined reference to symbol 'XGetWindowAttributes'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'hickit' failed
make: *** [hickit] Error 1

After I modified the Makefile, the last error about libglut & libX11 is gone while others still exist. How can these errors be corrected? thanks

lh3 commented

Others are warnings, not errors.

this line in th Makefile has been modified as follows

LIBS_GL = -Wl,-Bstatic -Wl,-Bdynamic -lglut -lGLU -lGL -lXi

but hickit-gl still doesn't work

lh3 commented

Makefile doesn't compile hickit-gl. Only hickit.

Problem solved. Thanks again.