Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile #4

Open
codeAC29 opened this issue Jul 5, 2018 · 6 comments
Open

Unable to compile #4

codeAC29 opened this issue Jul 5, 2018 · 6 comments

Comments

@codeAC29
Copy link

codeAC29 commented Jul 5, 2018

After running make I get the following error:

CXX src/main.cpp
CXX/LD seg_label_generate
/usr/bin/ld: build/src/seg_label_generator.o: undefined reference to symbol '_ZN2cv7imwriteERKNS_6StringERKNS_11_InputArrayERKSt6vectorIiSaIiEE'
//usr/local/lib/libopencv_imgcodecs.so.3.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:39: recipe for target 'seg_label_generate' failed
make: *** [seg_label_generate] Error 1

Thanks

@yangtx2009
Copy link

I met the same problem. For me, the compilation works when I add two lines
OPENCV =`pkg-config opencv --cflags --libs`
LIBS = $(OPENCV)
before BUILD_DIR
and add @$(CXX) -o $@ $^ $(LDFLAGS) $(LIBS) in $(PROJECT_NAME): ...

@panlanlan
Copy link

@yangtx2009 OPENCV =pkg-config opencv --cflags --libs
LIBS = $(OPENCV)
@$(CXX) -o $@ $^ $(LDFLAGS) $(LIBS) in $(PROJECT_NAME): ...
which files and lines in the files i should modify it
can you tell me it ?

@nikhilbv
Copy link

nikhilbv commented Jul 18, 2019

@yangtx2009 Even I'm facing the same problem. Can you please clarify the solution?

Screenshot from 2019-07-18 17-52-26

@mengzhibin
Copy link
Contributor

mengzhibin commented Aug 14, 2019

@nikhilbv He is meaning the Makefile file.

@XieZixiUSTC
Copy link

/usr/bin/ld: build/src/evaluate.o: undefined reference to symbol '_ZN2cv6imreadERKNS_6StringEi'
i meet this problem too

@zchrissirhcz
Copy link
Contributor

@XieZixiUSTC Consider adding opencv_imgcodecs in makefile. This OpenCV component includes the definition of imread for OpenCV3/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants