Compile error question

This is a discussion on Compile error question within the C++ Programming forums, part of the General Programming Boards category; Hi, I am getting this weird error when I try to make that I can't seem to fix. http.c:80: error: ...

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    8

    Compile error question

    Hi,

    I am getting this weird error when I try to make that I can't seem to fix.

    http.c:80: error: storage size of ‘start_tpz’ isn’t known
    http.c:80: error: storage size of ‘conn_tpz’ isn’t known
    http.c:80: error: storage size of ‘end_tpz’ isn’t known

    Those three variables are of type struct timezone.

    I have:
    #include <sys/time.h>
    which includes the instantiation of the timezone struct, so it shouldn't be a problem. I also added simply time.h, to no effect.

    Anybody know what's going on?

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,651
    Those are your variables, so it comes down to what is the code at line 80 and where are those variables declared in relation to line 80?

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,246
    Your headers probably don't declare the type, just forward-declare it to make some prototypes happy.

    From the glibc docs:

    The struct timezone type is obsolete and should never be used. Instead, use the facilities described in 21.4.8 Functions and Variables for Time Zones.
    Maybe one of the reasons it "should never be used" is because they haven't actually declared it anywhere. Just a guess though.

    EDIT: Yes, the gettimeofday() call takes a timezone pointer as a parameter. You ought to be passing NULL for that. Nobody uses that crud anymore and it's even been completely removed from some systems (such that if you pass a non-NULL timezone pointer, the kernel says ENOSYS)
    Last edited by brewbuck; 09-16-2010 at 04:54 PM.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  4. #4
    Registered User
    Join Date
    Sep 2010
    Posts
    8
    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C and C++ compile speed
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-02-2007, 01:37 PM
  2. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 12:36 PM
  3. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 07:20 AM
  4. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 08:05 PM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 01:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21