Code::Blocks Forums

User forums => Help => Topic started by: Blocks++Code on December 04, 2012, 11:24:12 pm

Title: Trouble with setting up a new compiler
Post by: Blocks++Code on December 04, 2012, 11:24:12 pm
I wanted to set up Code::Blocks for the ELF GCC on Windows.
I wanted to manage the code for my very little operating system kernel.

But there were some trouble with the configuration.
I had copied the GCC compiler settings and I had changed some settings.
Then the compiling and the linking have worked.

Today I started Code::Blocks and there was shown up a big error window. ("Compiler auto-detection")
All relative compiler paths are displayed invalid.
Why doesn't relative paths work any more, when I have added a custom compiler?
Is it a bug?

My settings in "default.conf":
Code
		<user_sets>
         <gccelf>
<NAME>
<str>
<![CDATA[GNU GCC Compiler ELF]]>
</str>
</NAME>
<PARENT>
<str>
<![CDATA[gcc]]>
</str>
</PARENT>
<COMPILER_OPTIONS>
<str>
<![CDATA[-m32 -ffreestanding -Wall -nostdinc;]]>
</str>
</COMPILER_OPTIONS>
<LIBRARIES>
<str>
<![CDATA[lib;lib\gcc\i586-elf\4.4.0;]]>
</str>
</LIBRARIES>
<INCLUDE_DIRS>
<str>
<![CDATA[include;lib\gcc\i586-elf\4.4.0\include;]]>
</str>
</INCLUDE_DIRS>
<MASTER_PATH>
<str>
<![CDATA[$(Codeblocks)\..\MinGW\OSprogramming\lib\gcc\i586-elf\4.4.0]]>
</str>
</MASTER_PATH>
<C_COMPILER>
<str>
<![CDATA[i586-elf-gcc.exe]]>
</str>
</C_COMPILER>
<CPP_COMPILER>
<str>
<![CDATA[i586-elf-g++.exe]]>
</str>
</CPP_COMPILER>
<LINKER>
<str>
<![CDATA[i586-elf-ar.exe]]>
</str>
</LINKER>
<LIB_LINKER>
<str>
<![CDATA[i586-elf-ld.exe;]]>
</str>
</LIB_LINKER>
<RES_COMPILER>
<str>
<![CDATA[-]]>
</str>
</RES_COMPILER>
</gccelf>
<nasm>
<NAME>
<str>
<![CDATA[NASM Netwide Assembler]]>
</str>
</NAME>
<PARENT>
<str>
<![CDATA[gcc]]>
</str>
</PARENT>
<COMPILER_OPTIONS>
<str>
<![CDATA[-f elf32;]]>
</str>
</COMPILER_OPTIONS>
<MASTER_PATH>
<str>
<![CDATA[$(Codeblocks)\..\NASM]]>
</str>
</MASTER_PATH>
<C_COMPILER>
<str>
<![CDATA[nasm.exe]]>
</str>
</C_COMPILER>
<CPP_COMPILER>
<str>
<![CDATA[nasm.exe]]>
</str>
</CPP_COMPILER>
<MAKE>
<str>
<![CDATA[make.exe]]>
</str>
</MAKE>
<switches>
<LOGGING int="1" />
</switches>
</nasm>
</user_sets>
Title: Re: Trouble with setting up a new compiler
Post by: MortenMacFly on December 05, 2012, 08:49:14 pm
Version (OS, C::B, compiler), platform, please?! ::)
Title: Re: Trouble with setting up a new compiler
Post by: Blocks++Code on December 05, 2012, 10:37:02 pm
I use a nightly. So far as I know it is svn 8500.
But i have tried the latest. There is the same problem.

I work on a pc with Windows Vista.
The problem doesn't come from the compiler because I have copied the "user_sets" compiler settings to a predefined compiler stub and the error disappeared. (There were many other problems logically)

The compilers which I would add are an elf gcc (4.4.0) and nasm (2.0.7)

Then I have also tried to use absolute paths.
I have found, however, that it refuses anyway.
Title: Re: Trouble with setting up a new compiler
Post by: MortenMacFly on December 06, 2012, 09:20:06 am
because I have copied the "user_sets" compiler settings to a predefined compiler stub
You are not supposed to change the config like that and what you did cannot work. If you do, bad things including crashes can happen. Only C::B itself shall read/write the config. If you want to "fiddle" with the compiler options, try the xml_compiler branch.
Title: Re: Trouble with setting up a new compiler
Post by: Blocks++Code on December 06, 2012, 02:33:00 pm
I configured Code::Blocks itself without change something in the config directly.
Because it was not working, I searched myself for the error in the file.

I would happy already if I could add a new compiler on the provided way.
Nevertheless, the xml_compiler branch sounds interesting.