NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on March 17, 2007, 11:40:12 AM

Title: Undefined symbol stdin
Post by: nobody 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???
Title: Re: Undefined symbol stdin
Post by: Frank Kotler on March 17, 2007, 12:34:11 PM
Try adding "-lc" to the gcc command-line to link in libc.

Best,
Frank
Title: Re: Undefined symbol stdin
Post by: nobody 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.
Title: Re: Undefined symbol stdin
Post by: Keith Kanios 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 ;)