0

I want to https://github.com/Rventric/Text-Detection but if i run this command :

g++ -o  DEMO Demo.cpp `pkg-config opencv --cflags --libs`

i get this error :

/tmp/ccTKjiBu.o: In function `main':
Demo.cpp:(.text+0x159): undefined reference to `TextDetection::detectText(cv::Mat const&, std::vector<std::string, std::allocator<std::string> >, bool)'
/tmp/ccTKjiBu.o: In function `LinkCandidate::LinkCandidate()':
Demo.cpp:(.text._ZN13LinkCandidateC2Ev[_ZN13LinkCandidateC5Ev]+0x4c): undefined reference to `Iqueue::Iqueue()'
/tmp/ccTKjiBu.o: In function `GetCandidate::GetCandidate()':
Demo.cpp:(.text._ZN12GetCandidateC2Ev[_ZN12GetCandidateC5Ev]+0x77): undefined reference to `Swt::Swt()'
/tmp/ccTKjiBu.o: In function `VericaficationTextLine::VericaficationTextLine()':
Demo.cpp:(.text._ZN22VericaficationTextLineC2Ev[_ZN22VericaficationTextLineC5Ev]+0x25): undefined reference to `FilterBox::FilterBox()'
collect2: error: ld returned 1 exit status

who to resolved this error ?

  • Fix the problem by defining the functions that the linker can't find. Based on your g++ command line, you forgot the argument to `-o` which means your `TextDetection.cpp` file wasn't being compiled -- and might have been clobbered. – cdhowie May 09 '17 at 03:40
  • @cdhowie How to do it? give me the command please – Rahim Kasmi May 09 '17 at 03:57

1 Answers1

3

Whoops, you are trying to create an executable file called TextDirection.cpp. You didn't specify an output file name to go with the -o flag. If you want to create the executable called demo, then you need

g++ -o demo TextDetection.cpp Demo.cpp `pkg-config opencv --cflags --libs`

Also, you might need to recover the original source file TextDirection.cpp, as you may have inadvertently destroyed it.

paddy
  • 60,864
  • 6
  • 61
  • 103