Find the answer to your Linux question:
Results 1 to 4 of 4
Hi everyone I am doing a simple SSL server program using OpenSSL. I just initialize the OpenSSL library and i compile. Then the GCC return a warning message "data definition ...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    19

    warning: data definition has no type or storage class

    Hi everyone

    I am doing a simple SSL server program using OpenSSL. I just initialize the OpenSSL library and i compile. Then the GCC return a warning message "data definition has no type or storage class. The snippet is as below :-

    Code:
    #include <stdio.h>
    #include <openssl/bio.h>
    #include <openssl/ssl.h>
    #include <openssl/err.h>
    
    OpenSSL_add_all_algorithms(); //This is where the warning message returned
    SSL_load_error_strings(); //This is where the warning message returned
    
    int main()
    {
       return 0;
    }
    Hope that anyone of you can help me. My OpenSSL version is 0.9.8g 19 Oct 2007.

    Thanks

  2. #2
    Just Joined!
    Join Date
    Jul 2009
    Posts
    58
    You can pre-declare your functions, but you can't call them outside of function.

    I hope that's just a cut-n-paste mistake and you see your problem, otherwise I think you need to start with a "hello world" and a couple of programming books. Programming isn't something you can just copy-n-paste from sources on the web.

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    15

    The same warning

    I try to use ANSI C hash-table implementation and also get the same warning (and 1 error and 1 note). The following snippet is from YACC declarations part:
    PHP Code:
    #include "strmap.h" // ANSI C hash-table implementation (definitions are in "strmap.c")
    // ...
    StrMap *SYMTAB;
    SYMTAB sm_new(10);
    // ... 
    Besides the warning (in the thread title), I also get
    Code:
    asm.y:(2nd line): error: conflicting types for ‘SYMTAB’
    asm.y:(1st line): note: previous declaration of ‘SYMTAB’ was here
    What am I doing wrong?

  4. #4
    oz
    oz is online now
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,095
    Hello, courteous!

    Please start a fresh thread of your own with the details on any problems you are having because this one is 2 years old.

    Thanks.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...