This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: function reference from standard library


>
>Another confusion in GCC :
>In my code I use 'strlen()' from standard library 'string.h'
>I have already included the header --->>> #include <string.h>
>Code is successfuly being compiled, but during linking, an error happens
>--->>> main.c(.text+0x666):main.c: undefined reference to strlen

Are you using -fno-builtin?  Sounds like the linker is trying to
resolve a reference to strlen as a library function, but can't find
it.

>Beside that I get a warning (I don't know would whether it will effect
>the functionality of my program or not), as I define main(){ ....}.
>The message is like this :
>main.c:51: warning: return-type defaults to 'int'  --->>> point to line
>begin of fucntion main()
>main.c:153: warning: control reaches end of non-void function  --->>>
>point to end of function main()

Sound like you are letting main() default to return type int.  The first
warning is telling you that you did not specify the return type of main().

Since the function is now defined as returning int (by default), the
compiler will issue a warning if the function can exit without returning
a specific int return value.

>Can anybody explain on that??
>Thank's

Hope this helps,
Art

________________________________________________
To get help for the crossgcc list, send mail to
crossgcc-request@cygnus.com with the text 'help'
(without the quotes) in the body of the message.