0

first I would like to state that I'm a very noob at c++. I am using to compile and run code from Features2D + Homography to find a known object tutorial, but I think I'm having trouble in linking correctly the libraries needed. I am getting this:

Invoking: GCC C++ Linker g++ -L/usr/local/lib -o "Homografia2" ./src/Homografia2.o -lopencv_core -lopencv_nonfree -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function _start': (.text+0x18): undefined reference tomain'
collect2: ld returned 1 exit status make: * [Homografia2] Error 1

**** Build Finished ****

I'm working on eclipse. Please, I really need help.

Matt Bryant
  • 4,841
  • 4
  • 31
  • 46

1 Answers1

2

The error is clear main function was not found. Are you missing it?

int main(int argc, char *argv[]){
  //start application.
}

Regards

Pedro Gandola
  • 196
  • 1
  • 11
  • What do you mean I am missing the main function? It is there – Livio Pires Dec 05 '13 at 15:20
  • Hi, The error is clear the **main()** function is missing. Please check [here](https://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fmainf.htm) if your main function declaration is correct. Supposing that it is correct then the problem can be the same that [this](http://stackoverflow.com/questions/11116399/crt1-o-in-function-start-undefined-reference-to-main-in-linux). Add **-nostartfiles** to your link options to avoid to use the standard system startup when linking. – Pedro Gandola Dec 07 '13 at 04:05