User forums > Using Code::Blocks
Whenever I add a class I get "Undefined reference to WinMain"
oBFusCATed:
stahta01: have you enabled all the options as show on the screenshot?
stahta01:
--- Quote from: oBFusCATed on November 11, 2014, 01:38:13 am ---stahta01: have you enabled all the options as show on the screenshot?
--- End quote ---
Prior to this no, but, I just checked the two that were missing and I still do NOT get the error.
The error would happen if main.cpp was NOT part of the windows project; this is the likely cause of the problem in my opinion.
Tim S.
oBFusCATed:
--- Quote from: stahta01 on November 11, 2014, 02:16:06 am ---The error would happen if main.cpp was NOT part of the windows project; this is the likely cause of the problem in my opinion.
--- End quote ---
No you're wrong here (I think). The error happens because CB passes -I without a path and messes the command line.
@SuperBoi45: Can you do a full rebuild and then post the full build log?
JohnnyCrow:
I ran into the same problem a while ago, but I figured out a simple solution to it in case anyone is still having trouble. After creating a new class (with .h and .cpp files) and linking it to the project, you have to save the project, close it, and reopen it. Problem solved. I'm not sure why this works, but it does.
oBFusCATed:
JonnyCrow: Can you post exact steps that reproduce the problem with a new minimal project?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version