Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

a c compiler error

  • 15-06-2006 6:47am
    #1
    Closed Accounts Posts: 1,829 ✭✭✭


    Guys, I'm trying to compile a simple enough c script on a HP UX box using gcc.
    I'm receiving the following error
    'incompatible implicit declaration of built-in function 'strlen' '

    The line in question simply reads cnt1=strlen(argv[1]);
    Any advice?
    JC


Comments

  • Registered Users, Registered Users 2 Posts: 243 ✭✭Blinder


    Have you included the correct h file?
    #include <string.h>


  • Registered Users, Registered Users 2 Posts: 6,570 ✭✭✭daymobrew


    Are you including strings.h? And what is argv declared as.
    Post more code.
    Useless sample of usage below:
    [PHP]#include <strings.h>

    int main(int argc, const char *argv[])
    {
    int cnt1;
    if ( argc >= 2 ) /* Gotta ensure there is an argv[1] to check. */
    cnt1 = strlen(argv[1]);

    return 0;
    }[/PHP]


  • Closed Accounts Posts: 1,829 ✭✭✭JackieChan


    Guys,
    thanks for your help.
    the problem was that string.h was not included.

    JC


Advertisement