edrosten / libcvd

libcvd - efficient and easy to use C++ computer vision library.
Other
239 stars 103 forks source link

Compiling Error in under Linux #3

Closed Hendrik-Unger closed 8 years ago

Hendrik-Unger commented 11 years ago

I am trying to build libCVD in order to use with ROS node tum_ardrone. I am working on a 64 bit Ubuntu machine if this matters.

My Problem is that I am getting the following errors:

make[3]: Entering directory `/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build' /usr/bin/g++-4.6 -o progs/cvd_display_image progs/cvd_display_image.o -L. -lcvd -ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -L -lX11 -lXext -pthread

./libcvd.so: undefined reference to `XMoveWindow'

./libcvd.so: undefined reference to `XCreateGlyphCursor'

./libcvd.so: undefined reference to `XStoreName'

./libcvd.so: undefined reference to `XLookupString'

./libcvd.so: undefined reference to `XFreeFont'

./libcvd.so: undefined reference to `XSetClassHint'

./libcvd.so: undefined reference to `XCreateWindow'

./libcvd.so: undefined reference to `XCreateColormap'

./libcvd.so: undefined reference to `XOpenDisplay'

./libcvd.so: undefined reference to `XDestroyWindow'

./libcvd.so: undefined reference to `XCloseDisplay'

./libcvd.so: undefined reference to `XUnmapWindow'

./libcvd.so: undefined reference to `XNextEvent'

./libcvd.so: undefined reference to `XSetWMProtocols'

./libcvd.so: undefined reference to `XResizeWindow'

./libcvd.so: undefined reference to `XMapWindow'

./libcvd.so: undefined reference to `XSelectInput'

./libcvd.so: undefined reference to `XFlush'

./libcvd.so: undefined reference to `XWarpPointer'

./libcvd.so: undefined reference to `XLoadQueryFont'

./libcvd.so: undefined reference to `XDefineCursor'

./libcvd.so: undefined reference to `XInternAtom'

./libcvd.so: undefined reference to `XQueryPointer'

./libcvd.so: undefined reference to `XUndefineCursor'

./libcvd.so: undefined reference to `XGetWindowAttributes'

./libcvd.so: undefined reference to XPending' collect2: ld returned 1 exit status make[3]: ** [progs/cvd_display_image] Error 1 make[3]: Leaving directory/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build' make[2]: \ [libcvd_built] Error 2

There is a stackoverflow question with nearly similar errors (undefined reference error while compiling libcvd).

I tried like it is suggested there to find out why there is no path given with the second -L option. So I ended up in the projects configure.in file, where I believe the error happens. But I have no experience with this build system, so help would be great.

The configure.in file is available under https://dl.dropboxusercontent.com/u/16804463/configure.in

Thanks in advance.

edrosten commented 11 years ago

Hi,

Can you send me the output of ./configure and also the config.log file.

You're correct: there is a bug with -L being empty. Hopefully those logs should help me track it down. Also, which version of ubuntu are you using?

-Ed

On 18 April 2013 09:26, Hendrik-Unger notifications@github.com wrote:

I am trying to build libCVD in order to use with ROS node tum_ardrone. I am working on a 64 bit Ubuntu machine if this matters.

My Problem is that I am getting the following errors:

make[3]: Entering directory `/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build' /usr/bin/g++-4.6 -o progs/cvd_display_image progs/cvd_display_image.o -L. -lcvd -ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -L -lX11 -lXext -pthread

./libcvd.so: undefined reference to `XMoveWindow'

./libcvd.so: undefined reference to `XCreateGlyphCursor'

./libcvd.so: undefined reference to `XStoreName'

./libcvd.so: undefined reference to `XLookupString'

./libcvd.so: undefined reference to `XFreeFont'

./libcvd.so: undefined reference to `XSetClassHint'

./libcvd.so: undefined reference to `XCreateWindow'

./libcvd.so: undefined reference to `XCreateColormap'

./libcvd.so: undefined reference to `XOpenDisplay'

./libcvd.so: undefined reference to `XDestroyWindow'

./libcvd.so: undefined reference to `XCloseDisplay'

./libcvd.so: undefined reference to `XUnmapWindow'

./libcvd.so: undefined reference to `XNextEvent'

./libcvd.so: undefined reference to `XSetWMProtocols'

./libcvd.so: undefined reference to `XResizeWindow'

./libcvd.so: undefined reference to `XMapWindow'

./libcvd.so: undefined reference to `XSelectInput'

./libcvd.so: undefined reference to `XFlush'

./libcvd.so: undefined reference to `XWarpPointer'

./libcvd.so: undefined reference to `XLoadQueryFont'

./libcvd.so: undefined reference to `XDefineCursor'

./libcvd.so: undefined reference to `XInternAtom'

./libcvd.so: undefined reference to `XQueryPointer'

./libcvd.so: undefined reference to `XUndefineCursor'

./libcvd.so: undefined reference to `XGetWindowAttributes'

./libcvd.so: undefined reference to XPending' collect2: ld returned 1 exit status make[3]: ** [progs/cvd_display_image] Error 1 make[3]: Leaving directory/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build' make[2]: \ [libcvd_built] Error 2

There is a stackoverflow question with nearly similar errors (undefined reference error while compiling libcvd).

I tried like it is suggested there to find out why there is no path given with the second -L option. So I ended up in the projects configure.infile, where I believe the error happens. But I have no experience with this build system, so help would be great.

The configure.in file is available under https://dl.dropboxusercontent.com/u/16804463/configure.in

Thanks in advance.

— Reply to this email directly or view it on GitHubhttps://github.com/edrosten/libcvd/issues/3 .

Hendrik-Unger commented 11 years ago

Hi,

I am happy to help you. My Ubuntu Version is 12.04, but I use the gcc version 4.6.3 ( believe that is not the standard one).

You can find the config.log file under: https://dl.dropboxusercontent.com/u/16804463/config.log The output of ./configure is: https://dl.dropboxusercontent.com/u/16804463/configure%20output.rtf

I you need anything else, just contact me. Thanks for your help.

edrosten commented 11 years ago

Hi,

Thanks for the files. I think I've found the bug.

Can you pull the latest version from git and see if it works?

-Ed

On 18 April 2013 13:45, Hendrik-Unger notifications@github.com wrote:

Hi,

I am happy to help you. My Ubuntu Version is 12.04, but I use the gcc version 4.6.3 ( believe that is not the standard one). You can find the config.log file under: https://dl.dropboxusercontent.com/u/16804463/config.log

I you need anything else, just contact me. Thanks for your help.

The Output of ./configure is:

parallels@parallels-Parallels-Virtual-Platform:/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build$

./configure checking for gcc... /usr/bin/gcc-4.6 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /usr/bin/gcc-4.6 accepts -g... yes checking for /usr/bin/gcc-4.6 option to accept ISO C89... none needed checking how to run the C preprocessor... /usr/bin/gcc-4.6 -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for gawk... no checking for mawk... mawk checking whether we are using the GNU C++ compiler... yes checking whether /usr/bin/g++-4.6 accepts -g... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking for ranlib... ranlib checking how to run the C++ preprocessor... /usr/bin/g++-4.6 -E checking if compiler flag -Wall works... yes checking if compiler flag -Wextra works... yes checking if compiler flag -pipe works... yes checking if compiler flag -ggdb works... yes checking if compiler flag -fPIC works... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for best optimize flags... checking if compiler flag -O3 works... yes checking CPU type... unknown


Checking processor specific features

checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking for MMX support... yes checking for MMXEXT support... yes checking for SSE support... yes checking for SSE2 support... yes checking for SSE3 support... yes checking size of void*... 8 checking for inline asm statement... yes checking assembler supports .type pseudo-op... yes


Checking for operating system specific features

checking dc1394/dc1394.h usability... no checking dc1394/dc1394.h presence... no checking for dc1394/dc1394.h... no checking for main in -ldc1394... no checking libraw1394/raw1394.h usability... no checking libraw1394/raw1394.h presence... no checking for libraw1394/raw1394.h... no checking libdc1394/dc1394_control.h usability... no checking libdc1394/dc1394_control.h presence... no checking for libdc1394/dc1394_control.h... no checking for main in -lraw1394... no checking for main in -ldc1394_control... no checking for v4l2... yes checking linux/videodev.h usability... no checking linux/videodev.h presence... no checking for linux/videodev.h... no checking kernel major number... 3 checking kernel minor number... 2 checking kernel release number... 0 checking for clock_getres in -lrt... yes


Checking for optional libraries

checking for X... libraries , headers checking for glDrawPixels in -lGL... yes checking GL/glu.h usability... yes checking GL/glu.h presence... yes checking for GL/glu.h... yes checking for gluGetString in -lGLU... yes checking for tr1::sharedptr... yes checking for TooN... no checking for old TooN... no checking for dgesvd in -lacml... no checking if Accelerate framework is needed for LAPACK... checking for dgesvd... no checking for dgesvd in -llapack... yes checking for working pthreads... yes checking for sched_yield... yes checking png.h usability... yes checking png.h presence... yes checking for png.h... yes checking for png_init_io in -lpng... yes checking for png_set_expand_gray_1_2_4_to_8 in -lpng... yes checking jpeglib.h usability... yes checking jpeglib.h presence... yes checking for jpeglib.h... yes checking for jpeg_destroy_decompress in -ljpeg... yes checking JPEG read buffer size... 1 (safe reading) checking tiffio.h usability... yes checking tiffio.h presence... yes checking for tiffio.h... yes checking for TIFFReadRGBAImage in -ltiff... yes checking for TIFFReadRGBAImageOriented in -ltiff... yes configure: WARNING: FFMPEG currently requires the use of --enable-gpl checking for doxygen... docs


Checking for platform compatibility

checking glob.h usability... yes checking glob.h presence... yes checking for glob.h... yes checking for glob... yes checking for GLOB_BRACE and GLOB_TILDE in glob.h... yes checking whether feenableexcept is declared... yes checking for posix_memalign... yes


Checking for extra build options

Options: inline_asm assembler v4l2buffer posix_rt videodisplay tr1_shared_ptr lapack pthread png jpeg tiff glob memalign

Missing options for linux-gnu: dc1394v1 dc1394v2 ffmpeg toon v4l1buffer

Dodgy things:

SIMD support: mmx mmxext sse sse2 sse3

Missing SIMD support for x86_64-unknown-linux-gnu:

-g -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread

-ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -L -lX11 -lXext -pthread Generating config... Files cvd/config_tmp.h and cvd/config.h differ New configuration configure: creating ./config.status config.status: creating Makefile

Hi,

Can you send me the output of ./configure and also the config.log file.

You're correct: there is a bug with -L being empty. Hopefully those logs should help me track it down. Also, which version of ubuntu are you using?

-Ed

Reply to this email directly or view it on GitHubhttps://github.com/edrosten/libcvd/issues/3#issuecomment-16574213 .

Hendrik-Unger commented 11 years ago

Hi,

I can do it, but it will take some time, I have to attend my lectures first. Really hope it works, you are doing me a big favour.

Greetings Hendrik Am 18.04.2013 15:18 schrieb "Edward Rosten" notifications@github.com:

Hi,

Thanks for the files. I think I've found the bug.

Can you pull the latest version from git and see if it works?

-Ed

On 18 April 2013 13:45, Hendrik-Unger notifications@github.com wrote:

Hi,

I am happy to help you. My Ubuntu Version is 12.04, but I use the gcc version 4.6.3 ( believe that is not the standard one). You can find the config.log file under: https://dl.dropboxusercontent.com/u/16804463/config.log

I you need anything else, just contact me. Thanks for your help.

The Output of ./configure is:

parallels@parallels-Parallels-Virtual-Platform:/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build$

./configure checking for gcc... /usr/bin/gcc-4.6 checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /usr/bin/gcc-4.6 accepts -g... yes checking for /usr/bin/gcc-4.6 option to accept ISO C89... none needed checking how to run the C preprocessor... /usr/bin/gcc-4.6 -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for gawk... no checking for mawk... mawk checking whether we are using the GNU C++ compiler... yes checking whether /usr/bin/g++-4.6 accepts -g... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking for ranlib... ranlib checking how to run the C++ preprocessor... /usr/bin/g++-4.6 -E checking if compiler flag -Wall works... yes checking if compiler flag -Wextra works... yes checking if compiler flag -pipe works... yes checking if compiler flag -ggdb works... yes checking if compiler flag -fPIC works... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for best optimize flags... checking if compiler flag -O3 works... yes checking CPU type... unknown


Checking processor specific features

checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no checking for MMX support... yes checking for MMXEXT support... yes checking for SSE support... yes checking for SSE2 support... yes checking for SSE3 support... yes checking size of void*... 8 checking for inline asm statement... yes checking assembler supports .type pseudo-op... yes


Checking for operating system specific features

checking dc1394/dc1394.h usability... no checking dc1394/dc1394.h presence... no checking for dc1394/dc1394.h... no checking for main in -ldc1394... no checking libraw1394/raw1394.h usability... no checking libraw1394/raw1394.h presence... no checking for libraw1394/raw1394.h... no checking libdc1394/dc1394_control.h usability... no checking libdc1394/dc1394_control.h presence... no checking for libdc1394/dc1394_control.h... no checking for main in -lraw1394... no checking for main in -ldc1394_control... no checking for v4l2... yes checking linux/videodev.h usability... no checking linux/videodev.h presence... no checking for linux/videodev.h... no checking kernel major number... 3 checking kernel minor number... 2 checking kernel release number... 0 checking for clock_getres in -lrt... yes


Checking for optional libraries

checking for X... libraries , headers checking for glDrawPixels in -lGL... yes checking GL/glu.h usability... yes checking GL/glu.h presence... yes checking for GL/glu.h... yes checking for gluGetString in -lGLU... yes checking for tr1::sharedptr... yes checking for TooN... no checking for old TooN... no checking for dgesvd in -lacml... no checking if Accelerate framework is needed for LAPACK... checking for dgesvd... no checking for dgesvd in -llapack... yes checking for working pthreads... yes checking for sched_yield... yes checking png.h usability... yes checking png.h presence... yes checking for png.h... yes checking for png_init_io in -lpng... yes checking for png_set_expand_gray_1_2_4_to_8 in -lpng... yes checking jpeglib.h usability... yes checking jpeglib.h presence... yes checking for jpeglib.h... yes checking for jpeg_destroy_decompress in -ljpeg... yes checking JPEG read buffer size... 1 (safe reading) checking tiffio.h usability... yes checking tiffio.h presence... yes checking for tiffio.h... yes checking for TIFFReadRGBAImage in -ltiff... yes checking for TIFFReadRGBAImageOriented in -ltiff... yes configure: WARNING: FFMPEG currently requires the use of --enable-gpl checking for doxygen... docs


Checking for platform compatibility

checking glob.h usability... yes checking glob.h presence... yes checking for glob.h... yes checking for glob... yes checking for GLOB_BRACE and GLOB_TILDE in glob.h... yes checking whether feenableexcept is declared... yes checking for posix_memalign... yes


Checking for extra build options

Options: inline_asm assembler v4l2buffer posix_rt videodisplay tr1_shared_ptr lapack pthread png jpeg tiff glob memalign

Missing options for linux-gnu: dc1394v1 dc1394v2 ffmpeg toon v4l1buffer

Dodgy things:

SIMD support: mmx mmxext sse sse2 sse3

Missing SIMD support for x86_64-unknown-linux-gnu:

-g -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread

-ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -L -lX11 -lXext -pthread Generating config... Files cvd/config_tmp.h and cvd/config.h differ New configuration configure: creating ./config.status config.status: creating Makefile

Hi,

Can you send me the output of ./configure and also the config.log file.

You're correct: there is a bug with -L being empty. Hopefully those logs should help me track it down. Also, which version of ubuntu are you using?

-Ed

Reply to this email directly or view it on GitHub< https://github.com/edrosten/libcvd/issues/3#issuecomment-16574213> .

— Reply to this email directly or view it on GitHubhttps://github.com/edrosten/libcvd/issues/3#issuecomment-16575707 .

Hendrik-Unger commented 11 years ago

I testet it and the Bug is still there. But I am not sure if I really downloaded your fixed Version. The Master Branch seems to be the most recent, but Git displays the last change was 2 days ago.

edrosten commented 11 years ago

Hi,

Sorry about thaT, I was off sick today and completely forgot to push it.

Try now.

-Ed

On 18 April 2013 22:07, Hendrik-Unger notifications@github.com wrote:

I testet it and the Bug is still there. But I am not sure if I really downloaded your fixed Version. The Master Branch seems to be the most recent, but Git displays the last change was 2 days ago.

— Reply to this email directly or view it on GitHubhttps://github.com/edrosten/libcvd/issues/3#issuecomment-16610143 .

Hendrik-Unger commented 11 years ago

No problem, I am glad you could help me :) The fix works well. Thank you again, you saved me a lot of trouble.

clod85 commented 11 years ago

Hi,

I have a very similar problem and I've spent much time trying to fix it but I haven't got any good results. That's the output from ./configure (https://dl.dropboxusercontent.com/u/72644037/configure_libcvd) . that is the config.log (https://dl.dropboxusercontent.com/u/72644037/config.log) . That's the output error I got after make:

g++ -O3 -I. -I. -INONE/include -g -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c progs/se3_exp.cxx -o progs/se3_exp.o g++ -o progs/se3_exp progs/se3_exp.o -L. -lcvd -ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -ldc1394 -pthread -lX11 -lXext ./libcvd.so: error: undefined reference to 'raw1394_new_handle' ./libcvd.so: error: undefined reference to 'raw1394_get_port_info' ./libcvd.so: error: undefined reference to 'raw1394_new_handle_on_port' ./libcvd.so: error: undefined reference to 'raw1394_iso_stop' ./libcvd.so: error: undefined reference to 'raw1394_iso_shutdown' ./libcvd.so: error: undefined reference to 'raw1394_reset_bus' ./libcvd.so: error: undefined reference to 'raw1394_destroy_handle' ./libcvd.so: error: undefined reference to 'png_set_longjmp_fn' collect2: ld returned 1 exit status make: *\ [progs/se3_exp] Error 1

"png_set_longjmp_fn" is probably regarded to some conflict with libpng, but I don't know how to fix that; "png_set_longjmp_fn" is not declared in reviuos versions of libpng but it doesn't work even changing the library with its new version on usr/include. I don't have much experience with that so please tell me how I can help you to find out the error. I run Ubuntu 12.04 LTS 32-bit.

edrosten commented 11 years ago

On 27 May 2013 14:31, clod85 notifications@github.com wrote:

Hi,

I have a very similar problem and I've spent much time trying to fix it but I haven't got any good results. That's the output from ./configure ( https://dl.dropboxusercontent.com/u/72644037/configure_libcvd) . that is the config.log (https://dl.dropboxusercontent.com/u/72644037/config.log) . That's the output error I got after make:

g++ -O3 -I. -I. -INONE/include -g -Wall -Wextra -pipe -ggdb -fPIC -mmmx -msse -msse -msse2 -msse3 -pthread -c progs/se3_exp.cxx -o progs/se3_exp.o g++ -o progs/se3_exp progs/se3_exp.o -L. -lcvd -ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt -ldc1394 -pthread -lX11 -lXext ./libcvd.so: error: undefined reference to 'raw1394_new_handle' ./libcvd.so: error: undefined reference to 'raw1394_get_port_info' ./libcvd.so: error: undefined reference to 'raw1394_new_handle_on_port' ./libcvd.so: error: undefined reference to 'raw1394_iso_stop' ./libcvd.so: error: undefined reference to 'raw1394_iso_shutdown' ./libcvd.so: error: undefined reference to 'raw1394_reset_bus' ./libcvd.so: error: undefined reference to 'raw1394_destroy_handle' ./libcvd.so: error: undefined reference to 'png_set_longjmp_fn'

Very odd. It looks like it's picking up libdc1394 OK, so I'm guessing that for some reason there's something up with libcd1394's links on your system. That would not surprise me: it's the kind of thing distro makers love to mess with.

Can you try two things:

first type:

ldd /path/to/libdc1394.so

secondly, manually add -lraw1394 to the Makefile after -ldc1394 and rebuild.

collect2: ld returned 1 exit status make: *\ [progs/se3_exp] Error 1

"png_set_longjmp_fn" is probably regarded to some conflict with libpng, but I don't know how to fix that; "png_set_longjmp_fn" is not declared in reviuos versions of libpng but it doesn't work even changing the library with its new version on usr/include. I don't have much experience with that so please tell me how I can help you to find out the

I'm not sure about the PNG thing, so I'll look into it. For the time being can you configure with --without-png as a workaround?

error. I run Ubuntu 12.04 LTS 32-bit.

I'm running 64 bit and don't have these problems. If we can't get them resolved quickly, I'll install 32 in a VM and see what happens.

-Ed