z80 Development Kit
You are not logged in.
Hi all,
What am I doing wrong here?
If I have two modules, say:
main.c
foo.c
and foo.c has a function 'int foo(int bar);'
all declared in foo.h (which is included in foo.c) - why do I get this
error when compiling main.c to an object file (not linking!)
1 errors occurred during assembly
Errors in source file main.c:
File '/tmp/tmpXXrLYKVQ.opt', Module 'MAIN', at line 80, Symbol not defined
But if I have a function called 'int foo()' (note, no arguments) in the
same arrangement, it compiles and links fine?
What do I need to do to be able to pass arguments to functions in other C
files?
Cheers.
--
Dylan Smith, Port St Mary, Isle of Man | Code fast, crash young and
Flying: http://www.dylansmith.net | leave a beautiful core.
FFE/Elite Universe: http://www.alioth.net | -- JK (#afe)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
On Sun, 24 Jun 2007, Dylan Smith wrote:
and foo.c has a function 'int foo(int bar);'
all declared in foo.h (which is included in foo.c) - why do I get this
error when compiling main.c to an object file (not linking!)
It needs to be extern int foo(int bar) in the header file, i.e. the extern
scoping is compulsory.
d.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Offline