Author Topic: Undefined symbol stdin  (Read 18032 times)

nobody

  • Guest
Undefined symbol stdin
« on: March 17, 2007, 11:40:12 AM »
Hello im new to solaris and nasm.

I've installed nasm on solaris 10 and getting error "undefined symbol stdin referenced in file FOO.o
I assemble and link like this: nasm -f elf FOO.asm gcc -g FOO.o -o FOO

in FOO.asm i have the line in the .text section: extern fgets
                                            extern stdin
as described by Jeff Duntemam.
What am i doing wrong please???

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Undefined symbol stdin
« Reply #1 on: March 17, 2007, 12:34:11 PM »
Try adding "-lc" to the gcc command-line to link in libc.

Best,
Frank

nobody

  • Guest
Re: Undefined symbol stdin
« Reply #2 on: March 17, 2007, 01:07:23 PM »
Hiyas Frank , i've tried that but no cigar. If you have more suggestion plz mail.
in the mean time i will mess with some PATH stuff.
thx for swift reply.

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Undefined symbol stdin
« Reply #3 on: March 17, 2007, 05:36:26 PM »
Isn't "STDIN" apart of the enumeration (STDIN, STDOUT, STDERR)???

If that is the case, change "extern stdin" to "%define stdin 0".

All-in-all, you would probably wish to use scanf() for STDIN, and printf() for STDOUT.

HtH ;)