opentoonz / GTS

GTS does Trace after Scan
https://opentoonz.github.io/download/gts.html
BSD 3-Clause "New" or "Revised" License
65 stars 15 forks source link

GTS build error in Linux #128

Closed sus-unn closed 6 years ago

sus-unn commented 6 years ago

I've downloaded opentoonz/GTS source using git. I followed instruction in README.md file, but $ ./autogen.sh && ./configure && make This command causes error while building. It seems to be error with OpenGL but I cannot figure out how to solve this problem, I am currently using Linux mint 18.3 Sylvia 64bit.

Error message:


(...)

In file included from sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:3:0:
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:18:5: error: #error no glu.h
 #   error no glu.h
     ^
In file included from sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:3:0:
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:248:2: error: ‘GLsizei’ does not name a type
  GLsizei _glsi_width,
  ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:250:2: error: ‘GLint’ does not name a type
  GLint _gli_skip_pixels,
  ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:252:2: error: ‘GLint’ does not name a type
  GLint _gli_rasterpos_x,
  ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:254:2: error: ‘GLenum’ does not name a type
  GLenum _gle_format,
  ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h: In constructor ‘iip_opengl_l1edit::iip_opengl_l1edit()’:
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:61:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_glsi_width’
   this->_glsi_width = (GLsizei)0;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:61:24: error: ‘GLsizei’ was not declared in this scope
   this->_glsi_width = (GLsizei)0;
                        ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:62:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_glsi_height’
   this->_glsi_height = (GLsizei)0;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:63:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gli_skip_pixels’
   this->_gli_skip_pixels = (GLint)0;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:63:29: error: ‘GLint’ was not declared in this scope
   this->_gli_skip_pixels = (GLint)0;
                             ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:64:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gli_skip_rows’
   this->_gli_skip_rows = (GLint)0;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:65:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gli_rasterpos_x’
   this->_gli_rasterpos_x = (GLint)0;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:66:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gli_rasterpos_y’
   this->_gli_rasterpos_y = (GLint)0;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:67:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   this->_gle_format = GL_RGB;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:67:23: error: ‘GL_RGB’ was not declared in this scope
   this->_gle_format = GL_RGB;
                       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:68:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_type’
   this->_gle_type = GL_UNSIGNED_BYTE;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:68:21: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
   this->_gle_type = GL_UNSIGNED_BYTE;
                     ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h: In member function ‘int iip_opengl_l1edit::get_i_glcrop_xpos()’:
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:225:45: error: ‘class iip_opengl_l1edit’ has no member named ‘_gli_skip_pixels’
  int get_i_glcrop_xpos(void) { return this->_gli_skip_pixels; }
                                             ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h: In member function ‘int iip_opengl_l1edit::get_i_glcrop_ypos()’:
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:226:45: error: ‘class iip_opengl_l1edit’ has no member named ‘_gli_skip_rows’
  int get_i_glcrop_ypos(void) { return this->_gli_skip_rows; }
                                             ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h: In member function ‘int iip_opengl_l1edit::get_i_glcrop_width()’:
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:227:46: error: ‘class iip_opengl_l1edit’ has no member named ‘_glsi_width’
  int get_i_glcrop_width(void) { return this->_glsi_width; }
                                              ^
sources/libcpp56iip_opengl/iip_opengl_l1edit.h: In member function ‘int iip_opengl_l1edit::get_i_glcrop_height()’:
sources/libcpp56iip_opengl/iip_opengl_l1edit.h:228:47: error: ‘class iip_opengl_l1edit’ has no member named ‘_glsi_height’
  int get_i_glcrop_height(void) { return this->_glsi_height; }
                                               ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp: In member function ‘void iip_opengl_l1edit::_pri_ch_info()’:
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:17:52: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_type’
  pri_funct_msg_v( " this->_gle_type   %4d ", this->_gle_type );
                                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:18:16: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_type’
  switch (this->_gle_type) {
                ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:19:7: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
  case GL_UNSIGNED_BYTE:
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:21:7: error: ‘GL_UNSIGNED_SHORT’ was not declared in this scope
  case GL_UNSIGNED_SHORT:
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:23:7: error: ‘GL_BITMAP’ was not declared in this scope
  case GL_BITMAP:
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:28:51: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
  pri_funct_msg_v( " this->_gle_format %4d ",this->_gle_format );
                                                   ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:29:16: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
  switch (this->_gle_format) {
                ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:30:7: error: ‘GL_RGB’ was not declared in this scope
  case GL_RGB:       pri_funct_msg_vr("GL_RGB"); break;
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:31:7: error: ‘GL_RGBA’ was not declared in this scope
  case GL_RGBA:      pri_funct_msg_vr("GL_RGBA"); break;
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:32:7: error: ‘GL_RED’ was not declared in this scope
  case GL_RED:       pri_funct_msg_vr("GL_RED"); break;
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:33:7: error: ‘GL_GREEN’ was not declared in this scope
  case GL_GREEN:     pri_funct_msg_vr("GL_GREEN"); break;
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:34:7: error: ‘GL_BLUE’ was not declared in this scope
  case GL_BLUE:      pri_funct_msg_vr("GL_BLUE"); break;
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:35:7: error: ‘GL_LUMINANCE’ was not declared in this scope
  case GL_LUMINANCE: pri_funct_msg_vr("GL_LUMINANCE"); break;
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:36:7: error: ‘GL_COLOR_INDEX’ was not declared in this scope
  case GL_COLOR_INDEX: pri_funct_msg_vr("GL_COLOR_INDEX"); break;
       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp: In member function ‘void iip_opengl_l1edit::init_channel()’:
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:51:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_type’
   this->_gle_type = GL_UNSIGNED_BYTE;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:51:21: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
   this->_gle_type = GL_UNSIGNED_BYTE;
                     ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:53:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_type’
   this->_gle_type = GL_UNSIGNED_SHORT;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:53:21: error: ‘GL_UNSIGNED_SHORT’ was not declared in this scope
   this->_gle_type = GL_UNSIGNED_SHORT;
                     ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:58:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_type’
   this->_gle_type = GL_BITMAP;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:58:21: error: ‘GL_BITMAP’ was not declared in this scope
   this->_gle_type = GL_BITMAP;
                     ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:59:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   this->_gle_format = GL_COLOR_INDEX;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:59:23: error: ‘GL_COLOR_INDEX’ was not declared in this scope
   this->_gle_format = GL_COLOR_INDEX;
                       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:61:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   this->_gle_format = GL_LUMINANCE;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:61:23: error: ‘GL_LUMINANCE’ was not declared in this scope
   this->_gle_format = GL_LUMINANCE;
                       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:64:9: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   this->_gle_format = GL_RGB;
         ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:64:23: error: ‘GL_RGB’ was not declared in this scope
   this->_gle_format = GL_RGB;
                       ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp: In member function ‘void iip_opengl_l1edit::set_channel(int, int)’:
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:85:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_RGB: this->_gle_format = GL_RGBA;  break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:85:36: error: ‘GL_RGBA’ was not declared in this scope
   case CH_RGB: this->_gle_format = GL_RGBA;  break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:86:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_RED: this->_gle_format = GL_RED;   break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:86:36: error: ‘GL_RED’ was not declared in this scope
   case CH_RED: this->_gle_format = GL_RED;   break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:87:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_GRE: this->_gle_format = GL_GREEN; break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:87:36: error: ‘GL_GREEN’ was not declared in this scope
   case CH_GRE: this->_gle_format = GL_GREEN; break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:88:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_BLU: this->_gle_format = GL_BLUE;  break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:88:36: error: ‘GL_BLUE’ was not declared in this scope
   case CH_BLU: this->_gle_format = GL_BLUE;  break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:89:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_ALP: this->_gle_format = GL_LUMINANCE; break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:89:36: error: ‘GL_LUMINANCE’ was not declared in this scope
   case CH_ALP: this->_gle_format = GL_LUMINANCE; break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:101:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_RGB: this->_gle_format = GL_RGB;   break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:101:36: error: ‘GL_RGB’ was not declared in this scope
   case CH_RGB: this->_gle_format = GL_RGB;   break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:102:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_RED: this->_gle_format = GL_RED;   break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:102:36: error: ‘GL_RED’ was not declared in this scope
   case CH_RED: this->_gle_format = GL_RED;   break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:103:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_GRE: this->_gle_format = GL_GREEN; break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:103:36: error: ‘GL_GREEN’ was not declared in this scope
   case CH_GRE: this->_gle_format = GL_GREEN; break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:104:22: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
   case CH_BLU: this->_gle_format = GL_BLUE;  break;
                      ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:104:36: error: ‘GL_BLUE’ was not declared in this scope
   case CH_BLU: this->_gle_format = GL_BLUE;  break;
                                    ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:107:11: error: ‘class iip_opengl_l1edit’ has no member named ‘_gle_format’
     this->_gle_format = GL_LUMINANCE;
           ^
sources/libcpp56iip_opengl/iip_opengl_l1edit_channel.cpp:107:25: error: ‘GL_LUMINANCE’ was not declared in this scope
     this->_gle_format = GL_LUMINANCE;
                         ^
Makefile:2579: recipe for target 'sources/libcpp56iip_opengl/libgts_la-iip_opengl_l1edit_channel.lo' failed
make[1]: *** [sources/libcpp56iip_opengl/libgts_la-iip_opengl_l1edit_channel.lo] Error 1
make[1]: Leaving directory '/home/(my-user-name)/git_repos/GTS'
Makefile:1018: recipe for target 'all' failed
make: *** [all] Error 2
stefantalpalaru commented 6 years ago

You might be missing "libglu1-mesa-dev" and, while you're at it, check that you have "mesa-common-dev", "libgl1-mesa-dev" and "libx11-dev" installed.

sus-unn commented 6 years ago

Thanks! I will check that later.

sus-unn commented 6 years ago

Error with libraries solved, but it makes another error:

/bin/bash ./libtool  --tag=CXX   --mode=link g++  -g -O2   -o gts sources/main/gts-main.o libgts.la -ltiff -Wl,-Bsymbolic-functions -lfltk_gl -lfltk -lX11 -lsane 
libtool: link: g++ -g -O2 -o gts sources/main/gts-main.o -Wl,-Bsymbolic-functions  ./.libs/libgts.a -ltiff -lfltk_gl -lfltk -lX11 /usr/lib/x86_64-linux-gnu/libsane.so
/usr/bin/ld: ./.libs/libgts.a(libgts_la-iip_opengl_l1edit_draw.o): undefined reference to symbol 'glRasterPos2d'
//usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:1833: recipe for target 'gts' failed
make[1]: *** [gts] Error 1
make[1]: Leaving directory '/home/(my-user-name)/git-repos/GTS'
Makefile:1018: recipe for target 'all' failed
make: *** [all] Error 2

I followed everything in README and it fails again.

stefantalpalaru commented 6 years ago

I followed everything in README

You're not actually supposed to delete "m4/ax_check_glu.m4" - I put it there for a reason, but some macOS user encountered an error and just deleted it instead of fixing it and somehow this voodoo software building reached the Linux instructions.

sus-unn commented 6 years ago

So I preserved "m4/ax_check_glu.m4", and yet it makes error in "configure":

checking for TIFF... yes
./configure: line 16340: _WITH_XQUARTZ_GL: command not found
./configure: line 16341: _WITH_XQUARTZ_GL: command not found
./configure: line 16368: syntax error near unexpected token `GLU,[CFLAGS],[LIBS]'
./configure: line 16368: ` AX_SAVE_FLAGS_WITH_PREFIX(GLU,[CFLAGS],[LIBS])'

I think it has something to do with "m4/ax_check_glu.m4" because only "configure" and "m4/ax_check_glu.m4" has "_WITH_XQUARTZ_GL".

stefantalpalaru commented 6 years ago

Do you have "libglu1-mesa-dev" installed?

For the next error you'll encounter, see this pull request: https://github.com/opentoonz/GTS/pull/131

sus-unn commented 6 years ago

Yes I have it installed. + Thanks for pull request

sus-unn commented 6 years ago

I'll retry with your commit and see if it works

stefantalpalaru commented 6 years ago

Let me know what versions are your automake, autoconf-archive, libtool and autoconf.

sus-unn commented 6 years ago

automake - 1:1.15-4ubun autoconf-archive- 20150925-1 libtool - 2.4.6-0.1
autoconf - 2.69-9

stefantalpalaru commented 6 years ago

I have automake-1.16.1, but 1.15 shouldn't be a problem either.

sus-unn commented 6 years ago
./configure: line 16340: _WITH_XQUARTZ_GL: command not found
./configure: line 16341: _WITH_XQUARTZ_GL: command not found
./configure: line 16368: syntax error near unexpected token `GLU,[CFLAGS],[LIBS]'
./configure: line 16368: ` AX_SAVE_FLAGS_WITH_PREFIX(GLU,[CFLAGS],[LIBS])'

Sorry but same errors are raised with your commit. (pull/131/head)

stefantalpalaru commented 6 years ago

Maybe you don't have "ax_save_flags_with_prefix.m4" in your autoconf archive. I added it to my pull request.

sus-unn commented 6 years ago
./configure: line 16340: _WITH_XQUARTZ_GL: command not found
./configure: line 16341: _WITH_XQUARTZ_GL: command not found
./configure: line 16437: syntax error near unexpected token `GLU,[CFLAGS],[LIBS]'
./configure: line 16437: ` AX_RESTORE_FLAGS_WITH_PREFIX(GLU,[CFLAGS],[LIBS])  ac_ext=c'

It is still the same. Yours is fine, right?

stefantalpalaru commented 6 years ago

Did you run "./autogen.sh" again after pulling my latest commit? I'm not getting any errors and the first "configure" section that gives you problems should look like this:

# Check whether --with-xquartz-gl was given.
if test "${with_xquartz_gl+set}" = set; then :
  withval=$with_xquartz_gl; if test "X$with_xquartz_gl"="Xyes"; then :
  with_xquartz_gl="/opt/X11"
fi
else
  with_xquartz_gl=no
fi
stefantalpalaru commented 6 years ago

After adding "m4/ax_restore_flags_with_prefix.m4", it compiles on Ubuntu-16.04. Now I need some macOS user to test this and I can remove the ugly workaround from the macOS instructions.


later edit: I tested it myself on macOS Sierra and fixed another problem in the process. I also updated the specific instructions.

sus-unn commented 6 years ago

Yes it works now. Thanks.