Hello. I was unsure what forum reporting this bug would be appropriate in.
On windows vista, Code::Blocks 10.05. It is incorrectly reported that a redefinition error occurs:
D\main.cpp||In function 'const bool DeleteFileA(const char*)':|
D\main.cpp|12|error: new declaration 'const bool DeleteFileA(const char*)'|
c:\program files\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\..\include\winbase.h|1291|error: ambiguates old declaration 'BOOL DeleteFileA(const CHAR*)'|
||=== Build finished: 2 errors, 0 warnings ===|
Notice that it says 'DeleteFileA'. The problem is, my function is just called 'DeleteFile' (there is no A in it), and that there is somehow a redefinition error between 'DeleteFile' (which it mistakenly calls DeleteFileA) and 'DeleteFileA'.
Below is the code to reproduce the problem:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <winbase.h>
const bool DeleteFile(const char FileName[])
{
if(remove(FileName) != 0)
{
return false;
}
return true;
}
int main(int ArgC, char *ArgV[])
{
return 0;
}
I have also uploaded a screenshot of both the code and the failed compilation attempt:
http://img844.imageshack.us/img844/6443/compilebug.jpgWhilst I know this forum distinguishes between IDE and compiler, I am absolutely confused by everything, and wasn't sure where best to post this, given this redefinition error shouldn't be occurring at all. I would understand if 'DeleteFile' conflicted with an earlier version of 'DeleteFile', but it's somehow conflicting with 'DeleteFileA' instead.
I will add: If 'DeleteFile' is declared before winbase.h, no such redefinition conflict error occurs.