Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msvc11 compile error #2

Open
maksqwe opened this issue Nov 15, 2013 · 2 comments
Open

msvc11 compile error #2

maksqwe opened this issue Nov 15, 2013 · 2 comments

Comments

@maksqwe
Copy link

maksqwe commented Nov 15, 2013

"error C2079: 'ftphandle::idletime' uses undefined struct 'timeval'"

struct 'timeval' defined in "winsock2.h":
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740560%28v=vs.85%29.aspx

fix:

#ifndef _WIN32
#include <unistd.h>
#include <sys/time.h>
#else
#include <winsock2.h>
#endif
@mkulke
Copy link
Owner

mkulke commented Nov 20, 2013

hmm weird. In msvc12 "timeval" is defined in "winsock.h", which is included in "ftplib.cpp". In an msvc11 environment "winsock.h" does not contain a "timeval" definition?

@maksqwe
Copy link
Author

maksqwe commented Nov 21, 2013

When I tried compile using msvc11 I got this error. MSDN says that "winsock2.h" is necessary for 'timeval'. Now i checked "winsock.h"(msvc11) and really it contain "timeval" definition. But anyway ftplib.h require include "winsock.h" because of

struct ftphandle {
    char *cput,*cget;
    int handle;
    int cavail,cleft;
    char *buf;
    int dir;
    ftphandle *ctrl;
    int cmode;
    struct timeval idletime; // <===
}

Sorry for my bad English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants