ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/usr/bin/ld: AcquireContinuous.o: undefined reference to symbol 'GenICam::GenericException::what() const'
/usr/bin/ld: note: 'GenICam::GenericException::what() const' is defined in DSO /opt/pylon/genicam/bin/Linux32_i86/libGCBase_gcc40_v2_1.so so try adding it to the linker command line
/opt/pylon/genicam/bin/Linux32_i86/libGCBase_gcc40_v2_1.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [AcquireContinuous] Error 1
I have got many solutions on google,but failed to rectify it.
I am not familiar with LD and linking.
Could someone pl guide step by step for this issue.
using ubuntu 12.04 32 bit
Note: code correctly compiling and linking in RHEL6
I contact the camera technical support,they have given me the exact solution but i do not know how to implement this,pl help
Their solution is:
Quote:
It turns out that this problem is caused by changing the Linker behavior in newer Linux distributions, i.e. Ubuntu 11.04 or 11.10, Fedora 13 etc.
That is, up to the above mentioned revisions, the Linker used to search for dependent libraries (indirect linking of shared library symbols) automatically. In the case of pylon, it is the libGCBase_gcc40_v2_1.
However, from e.g. Ubuntu 11.04 on all shared libs must be explicitly added to the command-line compiler flags in order to be found during compilation.
Hence, in this given case, use the following command-line switch:
# Makefile for Basler Pylon sample program
.PHONY : all clean
# the program to build
NAME := AcquireContinuous
# Build tools and flags
CXX := /usr/bin/g++
LD := /usr/bin/g++
CPPFLAGS := -I$(GENICAM_ROOT_V2_1)/library/CPP/include \
-I$(PYLON_ROOT)/include -DUSE_GIGE
CXXFLAGS := #e.g., CXXFLAGS=-g -O0 for debugging
# To keep the makefile for 32 and 64 in sync we add 64 and 32-bit library paths
# If you are targeting only 32 bit for you can remove the entries containing "64"
LDFLAGS := -L$(PYLON_ROOT)/lib64 \
-L$(PYLON_ROOT)/lib \
-L$(GENICAM_ROOT_V2_1)/bin/Linux64_x64 \
-L$(GENICAM_ROOT_V2_1)/bin/Linux64_x64/GenApi/Generic \
-L$(GENICAM_ROOT_V2_1)/bin/Linux32_i86 \
-L$(GENICAM_ROOT_V2_1)/bin/Linux32_i86/GenApi/Generic \
-Wl,-E
LIBS := -lpylonbase,-lGCBase_gcc40_v2_1
all : $(NAME)
$(NAME) : $(NAME).o
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
$(NAME).o : $(NAME).cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
clean :
$(RM) $(NAME).o $(NAME)
The Makefile already has the solution: they added -lGCBase_gcc40_v2_1 to the list of libraries that is used by the $(LD) command some lines below. I have doubts about the comma as separator (if it doesn't work change it to a blank space. Anyway, it's not clear what Makefile is this? This doesn't seem the one you had when trying make the first time, since in the command line you posted there is only -lpylonbase. If it is a Makefile they provided along with their support, you simply have to substitute the Makefile in the main installation directory and run make again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.