Unsolved what is reason behind below error when we execute make command ?
-
g++ -Wl,-O1 -o LaserModule -lQt5Gui -lQt5Core -lGLESv2 -lpthread
/usr/lib/gcc/arm-linux-gnueabihf/6/../../../arm-linux-gnueabihf/Scrt1.o: In function_start': (.text+0x44): undefined reference to
main'
collect2: error: ld returned 1 exit status
Makefile:125: recipe for target 'LaserModule' failed
make: *** [LaserModule] Error 1 -
@Qt-embedded-developer said in what is reason behind below error when we execute make command ?:
undefined reference to main'
Well, main() function is missing. Make sure you have a cpp file with main() function...
-
@Qt-embedded-developer said in what is reason behind below error when we execute make command ?:
g++ -Wl,-O1 -o LaserModule -lQt5Gui -lQt5Core -lGLESv2 -lpthread
Further to @jsulm correctly stating that
main
function is missing. If you look at this link line it outputs toLaserModule
but it does not seem to have any input module of your own at all. For example, if you have amain.cpp
we should be seeingmain.o
, or if you have aLaserModule.cpp
we should be seeingLaserModule.o
, among the files being linked. So look at your project/how this line was generated.