Ask Your Question
0

Linking OpenCV and AVT Manta Camera through PvAPI interface - different Ubuntu systems - errors occur

asked 2014-10-03 07:12:22 -0600

updated 2014-10-03 08:27:55 -0600

Lets wrap up the problem as compact as possible ...

I have two possible configurations

  1. SETUP 1: Ubuntu 12.04 - CodeBlocks 10.05 - GCC compiler 4.6.3 - G++ compiler 4.6.3
  2. SETUP 2: Ubuntu 14.04 - CodeBlocks 13.12 - GCC compiler 4.6.4 - G++ compiler 4.8.2

On both systems I fire up codeblocs, make a new console project and copy the following code - pastebin due to not screwing the main point - to the main.cpp file.

I then configure my codeblocks in a similar way. I add the PvAPI.h file to the project and fire up the linker options. I then add all the following dependencies to link libraries:

/home/spu/Software/AVT_sdk/lib-pc/x64/4.5/libPvAPI.a
/usr/lib/x86_64-linux-gnu/librt.a
/usr/lib/x86_64-linux-gnu/libpthread.a

And to the other linker options

`pkg-config opencv --libs`

So far so good, until I decide to built the actual project.

  1. SETUP 1: everything builds fine and I can grab frames from the AVT cam.
  2. SETUP 2: results in a giant list of errors in the pthread lib

You can see the errors below

||=== Build: Debug in AVT_gigE_OpenCV (compiler: GNU GCC Compiler) ===|
/usr/lib/x86_64-linux-gnu/libpthread.a(nptl-init.o)||In function `__pthread_initialize_minimal_internal':|
/build/buildd/eglibc-2.19/nptl/nptl-init.c|285|undefined reference to `__libc_setup_tls'|
/build/buildd/eglibc-2.19/nptl/nptl-init.c|303|undefined reference to `_dl_cpuclock_offset'|
/build/buildd/eglibc-2.19/nptl/nptl-init.c|419|undefined reference to `_dl_pagesize'|
/build/buildd/eglibc-2.19/nptl/nptl-init.c|428|undefined reference to `_dl_pagesize'|
/build/buildd/eglibc-2.19/nptl/nptl-init.c|448|undefined reference to `_dl_init_static_tls'|
/build/buildd/eglibc-2.19/nptl/nptl-init.c|450|undefined reference to `_dl_wait_lookup_done'|
/usr/lib/x86_64-linux-gnu/libpthread.a(nptl-init.o)||In function `__pthread_get_minstack':|
/build/buildd/eglibc-2.19/nptl/nptl-init.c|471|undefined reference to `_dl_pagesize'|
/usr/lib/x86_64-linux-gnu/libpthread.a(pthread_create.o)||In function `allocate_stack':|
/build/buildd/eglibc-2.19/nptl/allocatestack.c|475|undefined reference to `_dl_stack_flags'|
/build/buildd/eglibc-2.19/nptl/allocatestack.c|614|undefined reference to `_dl_stack_flags'|
/usr/lib/x86_64-linux-gnu/libpthread.a(ptw-write.o)||In function `__write_nocancel':|
/build/buildd/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S|81|undefined reference to `__syscall_error'|
/build/buildd/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S|81|undefined reference to `__syscall_error'|
/usr/lib/x86_64-linux-gnu/libpthread.a(ptw-read.o)||In function `__read_nocancel':|
/build/buildd/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S|81|undefined reference to `__syscall_error'|
/build/buildd/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S|81|undefined reference to `__syscall_error'|
/usr/lib/x86_64-linux-gnu/libpthread.a(ptw-close.o)||In function `__close_nocancel':|
/build/buildd/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S|81|undefined reference to `__syscall_error'|
/usr/lib/x86_64-linux-gnu/libpthread.a(ptw-close.o):/build/buildd/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S|81|more undefined references to `__syscall_error' follow|
||=== Build failed: 15 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

After that I decided to make the G++ and Gcc compiler identical on both systems, error stills occur. Anyone has an idea what is going wrong?

UPDATE

I can ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-10-03 08:56:01 -0600

updated 2014-10-03 09:06:24 -0600

Finally found it the hard way, no idea why it worked on the other system but I found a universal solution. Replace

/usr/lib/x86_64-linux-gnu/librt.a
/usr/lib/x86_64-linux-gnu/libpthread.a

By their dynamic components

/usr/lib/x86_64-linux-gnu/librt.so
/usr/lib/x86_64-linux-gnu/libpthread.so

Which results in a perfect build

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-10-03 07:12:22 -0600

Seen: 1,017 times

Last updated: Oct 03 '14