Jump to content



Photo
- - - - -

Trying To Compile With Sh3eb-unknown-GNU/Linux-gnu-gcc


  • Please log in to reply
1 reply to this topic

#1 rakiem

rakiem

    Newbie

  • Members
  • Pip
  • 1 posts

  • Calculators:
    fx-9860SD

Posted 03 February 2008 - 03:54 AM

I recently installed a crosstool following instructions from http://linux-sh.org/shwiki/Crosstool. I have a debian host and I have read project from http://fxsdk.sourceforge.net/.
It seems that crosstool have installed succesfully but when I try to compile a simple program (p.e. main.c) an error occurs

sh3eb-unknown-<{GNULINUX}>-gnu-gcc -O9 -nostdlib -lgcc -Xlinker "-Taddin.ld" init.c init.s main.c -o myaddin
   /tmp/ccoptgnW.o: In function `main':
   main.c:(.text+0x14): undefined reference to `printf'
   collect2: ld returned 1 exit status

The file main.c is this
#include <stdio.h>
   int main(){
		   printf("hello");
   }

When I complile without any option ( only "sh3eb-unknown-<{GNULINUX}>-gnu-gcc" ) there's no output error.

I just googled all over but I'm found nothing, if anyone can help about this error ??!!
:(

#2 kucalc

kucalc

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1422 posts
  • Gender:Male
  • Location:USA
  • Interests:Programming: C/C++, Fortran, LISP, COBOL 85 Standard, PHP, x86 and SH3 Assembly

    Computer graphics

  • Calculators:
    fx-9860G / fx-7400G Plus / Algebra FX 2.0+ / fx-9770G / CFX-9850G / CFX-9850GB+ / TI-89 / TI-nSpire

Posted 03 February 2008 - 04:20 AM

Hey rakiem. :)

Since you've not included the standard libraries: -nostdlib, you can't use printf() unless you implement it yourself.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users