Hi !
I'm new user of Code::Blocks and i started with avr-gcc project.
My project compile fine in command line (not with Code::Blocks) with my custom Makefile.
I've trying to copy out this Makefile in Code::Blocks but when i compile, i've this error :
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
I've trying with my custom Makefile (By checking « This is a custom Makefile » in Project properties) but i've the same error.
I think that installing the package "glibc-devel.i686" can solve the problem but why Code: Blocks would need this package which compile fine in command line ?
Thanks
Seems the autodetection fails, see for the details: CompilerGNUAVR::AutoDetectInstallationDir()
http://svn.berlios.de/wsvn/codeblocks/trunk/src/plugins/compilergcc/compilerGNUAVR.cpp?peg=7359
Seems like the m_MasterPath is not set correctly.
m_MasterPath is set by :
if (platform::windows)
{
....
}
else // if platform::linux
m_MasterPath = _T("/usr");
But what is the usefulness of adding this include path ?
AddIncludeDir(m_MasterPath + sep + _T("include"));
After installing avr-gcc, I cam confirm this issue.
If the compiler-plugin detects the gnu-avr-gcc compiler it adds /usr/include and /usr/lib to the appropriate search dirs, but this is (of course) wrong for a cross-compiler.
I guess none of these is normally needed as long as only compiler-included headers and libs are used, because the compiler normally knows where to search.
I am not sure if it is needed on windows, normally it should not.
The wrong search-dirs are only added, if auto-detection does not fail:
AutoDetectResult ret = wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C) ? adrDetected : adrGuessed;
if (ret == adrDetected)
{
if (platform::windows)
{
AddIncludeDir(m_MasterPath + sep + _T("avr\\include"));
AddLibDir(m_MasterPath + sep + _T("avr\\lib"));
m_ExtraPaths.Add(m_MasterPath + sep + _T("utils") + sep + _T("bin")); // for make
}
else
{
AddIncludeDir(m_MasterPath + sep + _T("include"));
AddLibDir(m_MasterPath + sep + _T("lib"));
}
}
m_MasterPath is /usr, because the executables are in /usr/bin as nearly in all cases on linux.
That's the cause, why I did not see them until I installed the compiler.