Page 1 of 1

[Solved] GCC CrossCompiler: No usable dependency syles found

Posted: Mon Nov 16, 2015 6:14 am
by Kirdow
I've been coding an Assembly operating system for 1 - 2 months, and realized it will be better if I used 32-bit and C. So I was looking into Cross Compiler stuff and such and saw that it's best to have linux. And because I have 2 drives, One 120GB SSD and a 1TB HDD, I thought I could install Ubuntu on a partition on my HDD. So I'm now running dual-boot Windows and Ubuntu, where I use Ubuntu for Linux access and OS Coding, and Windows for gaming/school/other programming stuff. I've downloaded all the stuff I need (I'm following http://wiki.osdev.org/GCC_Cross-Compiler) and I'm now trying to compile my cross compiler.

The preparation is very easy. Then we have the Binutils, which it seems I completed without errors. Then we have the GCC part, where we build our cross compiler. That's where it fails. First I check if the $TARGET-as folder exists, and it does. Then I create the build-gcc folder and enters it. I then run the

Code: Select all

../gcc-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
which also seem to succeed. But then I run "make all-gcc". That one runs for 10 - 30 seconds, until it ends with

Code: Select all

checking dependency style of g++... none
configure: error: no usable dependency style found
make: *** [configure-gcc] Error 1
I've searched around to fix it for 1 - 2 hours. Still can't find (I think) what I need. So I ask you, what can I do to solve it?

Solution
BASICFreak wrote:
Kirdow wrote:
mallard wrote:It's also worth posting the version of GCC that you're compiling the cross-compiler with. Also check that you have C++ support (g++) installed, a quick Google suggests that if that's missing you'll get this error.
Where should g++ be located? I downloaded gcc-4.9.2 and assumed c++ compiler (g++) was in there, that's wrong then?
Kirdow wrote:where I use Ubuntu for Linux access and OS Coding
Since you are using ubuntu, you can grab it off the repo:
sudo apt-get install g++
This solved it, I forgot that when I used g++ it was on my Windows 10. I've never used g++ on my Ubuntu. Installing g++ made the trick.

Re: GCC Cross Compiler: No usable dependency syles found

Posted: Mon Nov 16, 2015 6:32 am
by Octocontrabass
What versions of binutils and gcc are you building?

What are your $TARGET and $PREFIX?

What is in the configure.log for the failed configure script? (There will probably be more than one, so you might have to dig around a bit to find the one that failed.)

Re: GCC Cross Compiler: No usable dependency syles found

Posted: Mon Nov 16, 2015 7:14 am
by Kirdow
I'm using Binutils 2.24 and GCC 4.9.2

$TARGET = i686-elf and $PREFIX = /home/kirdow/opt/cross

How do I get the configure.log? A bit tired today so I may need some extra help

Re: GCC Cross Compiler: No usable dependency syles found

Posted: Mon Nov 16, 2015 8:50 am
by Octocontrabass
Kirdow wrote:How do I get the configure.log? A bit tired today so I may need some extra help
In your build directory, run this to list all of the configure.log files.

Code: Select all

find . -name "configure.log"

Re: GCC Cross Compiler: No usable dependency syles found

Posted: Mon Nov 16, 2015 10:13 am
by mallard
It's also worth posting the version of GCC that you're compiling the cross-compiler with. Also check that you have C++ support (g++) installed, a quick Google suggests that if that's missing you'll get this error.

Re: GCC Cross Compiler: No usable dependency syles found

Posted: Mon Nov 16, 2015 1:16 pm
by Kirdow
mallard wrote:It's also worth posting the version of GCC that you're compiling the cross-compiler with. Also check that you have C++ support (g++) installed, a quick Google suggests that if that's missing you'll get this error.
Where should g++ be located? I downloaded gcc-4.9.2 and assumed c++ compiler (g++) was in there, that's wrong then?

Re: GCC Cross Compiler: No usable dependency syles found

Posted: Mon Nov 16, 2015 1:29 pm
by BASICFreak
Kirdow wrote:
mallard wrote:It's also worth posting the version of GCC that you're compiling the cross-compiler with. Also check that you have C++ support (g++) installed, a quick Google suggests that if that's missing you'll get this error.
Where should g++ be located? I downloaded gcc-4.9.2 and assumed c++ compiler (g++) was in there, that's wrong then?
Kirdow wrote:where I use Ubuntu for Linux access and OS Coding
Since you are using ubuntu, you can grab it off the repo:
sudo apt-get install g++

Re: GCC Cross Compiler: No usable dependency syles found

Posted: Tue Nov 17, 2015 1:15 pm
by Kirdow
Thanks, I installed g++ like BASICFreak said, and it worked.
I've updated the post to contain the solution (with your quotes) and added a [Solved] prefix to the title.