Search code examples
c++linkerprogram-entry-point

Unable to compile [MinGW]


I try to run this code, but I encounter the error as shown above . My first assumption is the linker file is incorrect. If my linker file is incorrect, then what should I change for the linker file? My second assumption is I set a wrong path to the linker file. Currently, I set my path to C:\Apps\MinGW\bin. If my path is wrong, then what should I set my path to?


Solution

  • Not sure where you got the idea that the entry point should be called run. It should be called main, just rename it:

    int main () 
    {
        ....
    }
    

    That particular error message is a bit misleading to the untrained eye (explaining it goes further down the rabbit hole than I'd like to go) but that's essentially what that one means in this context.