Using gcc cross compiler problem (noob question)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
lasarus
Posts: 3
Joined: Fri Nov 12, 2010 5:45 pm

Using gcc cross compiler problem (noob question)

Post by lasarus »

Hi, this is my first post on this forum and I like this site very very much but I have a problem using my newly built cross compiler and I need your help.
I'm using Cyqwin and I think I've followed the cross compiler instructions right but when I try to use i586-elf-gcc to compile my kernel I get this error message:

/usr/local/cross/bin/i586-elf-gcc.exe: error while loading shared libraries: ?:
cannot open shared object file: No such file or directory

If somebody know what I'm doing wrong please tell me because I really want to make an OS.

btw I'm a noob at Linux/Cyqwin so please bare with me.
Dario
Member
Member
Posts: 117
Joined: Sun Aug 31, 2008 12:39 pm

Re: Using gcc cross compiler problem (noob question)

Post by Dario »

Looks like gcc is trying to link with some libraries that are missing (probably glibc, although not sure why???), but you shouldn't link standard library to your kernel anyway. Make sure you pass right flags to your compiler.
And if Linux is not such a big deal for you, drop Cygwin crap. ;)
____
Dario
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Using gcc cross compiler problem (noob question)

Post by Combuster »

What's your path set to? Did you change it and forgot the keep the original path intact?

Ever tried using dependency walker to see what (missing) libraries it needs or expects?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
lasarus
Posts: 3
Joined: Fri Nov 12, 2010 5:45 pm

Re: Using gcc cross compiler problem (noob question)

Post by lasarus »

Thank you for your replies! :D
Just to not embarrass myself what should the path be set to? :roll:
Last edited by lasarus on Mon Mar 07, 2011 12:27 pm, edited 1 time in total.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Using gcc cross compiler problem (noob question)

Post by AJ »

Hi,

To test what your path is set to, check the PATH variable (echo $PATH). The GCC Cross-Compiler article in the wiki states that you should use:

Code: Select all

export PATH=$PATH:$PREFIX/bin

to set your path variable correctly (assuming that you have correctly set PREFIX.

By uninstalling and reinstalling cygwin, you have done one of 2 things:
1. Removed your cross compiler...
2. Removed the cross compiler location from your PATH variable.

In either case, I suggest that it would help the original problem by following the steps cross compiler article again (from scratch). You may find that you missed something that will be magically resolved the second time (e.g. have you missed the --without-headers flag?).

HTH
Cheers,
Adam

[edit: I took ages to get my cross compiler working with Cygwin initially, but got there in the end - be persistant and it will work.]
lasarus
Posts: 3
Joined: Fri Nov 12, 2010 5:45 pm

Re: Using gcc cross compiler problem (noob question)

Post by lasarus »

Thank you for your response but I think I know what I did wrong(I'm such a noob).
The first time I removed everything from the PATH variable and the second time I took a 10 year old version of gcc.
But I'm yet to test if I have done everything correctly this time so I may come back for more help.
Post Reply