Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. what is reason behind below error when we execute make command ?
Qt 6.11 is out! See what's new in the release blog

what is reason behind below error when we execute make command ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 677 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by Qt embedded developer
    #1

    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

    jsulmJ JonBJ 2 Replies Last reply
    0
    • Q Qt embedded developer

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • Q Qt embedded developer

        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

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @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 to LaserModule but it does not seem to have any input module of your own at all. For example, if you have a main.cpp we should be seeing main.o, or if you have a LaserModule.cpp we should be seeing LaserModule.o, among the files being linked. So look at your project/how this line was generated.

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved