C++ undefined reference to WinMain@16 (Code::Blocks)

前端 未结 11 673
挽巷
挽巷 2020-12-09 22:20

I\'m learning C++ with Code::Blocks, and everytime i try to create a new class, I get an error message saying:

undefined reference to `WinMain@16\'
         


        
11条回答
  •  盖世英雄少女心
    2020-12-09 22:47

    I just had this issue too! The problem was that I put my main function under a specific namespace while my classes were not part of this namespace and looked like I have no "main" for them. As soon as I removed the namespace/added the classes to the same namespace the build issue was gone.

提交回复
热议问题