I am an enthusiastic C/C++ programmer who is new to this firmware customization field of studies. For my final year project I am developing a solution to enhance the packet switching of a router and selected OpenWRT as my opensource firmware. I have been struggling a bit to set up the environment and would like to get your expert opinion on if I am on the correct path.
I followed the following steps to get openWRT to my local PC. (http://wiki.openwrt.org/doc/howto/buildroot.exigence).
In the make menuconfig, I have selected, - Advanced configuration Options -Automatic rebuild of packages -ToolChain Options -Build gdb -Build the OpenWRT Image Builder -Build the OpenWRT SDK -Build the OpenWRT based ToolChain
and saved the config and ran the commands, - make tools/install - make toolchain/install
Then in Netbeans, I've added a new tool collection from Tools -> Options -> C/C++
and gave the base directory as '/openwrt/openwrt/toolchain'
and the C Complier as '/usr/bin/gcc'
Can you experts please advise me if I have done anything wrong? Is this sufficient to develop and compile a new C class to the openWRT firmware so that I can rebuild an image to be flashed into a router?
Your advice is much appreciated dear experts. I was struggling with this issue for quite some time :)
Thanks again :)
EDIT
The issue is that when i set the folder
/openwrt/openwrt/staging_dir/toolchain-i386_gcc-4.5-linaro_uClibc-0.9.32/i486-openwrt-linux
which refers in the tutorial http://downloads.openwrt.org/docs/eclipse.pdf to be set as the cross compiler in the IDE it given an error stating than no Compiler is found in both the eclipse and Netbeans.
BUT it works when i point to the /openwrt/openwrt/toolchain directory.
My query is that is it okey to press on with the development and use the Compiler within the toolchain folder to compile the project?
EDIT 2
The output I get when I run the command
find ./staging_dir -path "./staging_dir/toolchain*" -name *openwrt-linux
within the openwrt folder as suggested by TheCodeArtist is
./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_uClibc-0.9.33.2/mips-openwrt-linux
EDIT 3

EDIT 4

findcommand, it appears that you have built ONLY the MIPS toolchain and NOT the x86 toolchain in openwrt. Now if you are trying to compile a x86-executable/library for x86 target then you do NOT have the toolchain setup properly yet. go back and check openwrt documentation as to how to build a x86 toolchain first. Alternately if you intend to build a MIPS-executable/library for a MIPS router, then use the directory returned by the find command as the cross-compiler directory in eclipse/netbeans. Ensure that you provide a proper "prefix" alongwith it. - TheCodeArtistarm-none-linux-gccarm-none-linux-ar` etc. then the prefix isarm-none-linux-. Since you seem to be having a MIPS toolchain, it would be something along the lines ofmips-*-gccetc. within the./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_uClibc-0.9.33.2/mips-openwrt-linuxdirectory. Find and use the right prefix while specifying the toolchain directory. - TheCodeArtist