Hey all,
Am bumping up against the limits of my (limited) C/C++ knowledge (again). Perhaps somebody can help?
I'm trying to use libcurl from C++. Being pure C libcurl has no idea about C++'s implicit this pointer, so when used from C++ libcurl's callback fn's need to be defined as static . From what I understand, using the static qualifier turns a C++ member variable/function into one 'owned' by the class rather than an instance of that class (or probably something that the compiler sticks outside of the name-mangled mess of all the instances), which in turn removes the need for a this pointer.
So far so good.
My initial solution was to use a few (evil) global variables (why are they evil? they work and don't cause headaches). But when I move those globals into the class definition as static members, I get:
on each of the variables I moved into the class definition. However, the staticly defined class-method callback functions have been working from the beginning.
What am I missing here?
J.
Am bumping up against the limits of my (limited) C/C++ knowledge (again). Perhaps somebody can help?
I'm trying to use libcurl from C++. Being pure C libcurl has no idea about C++'s implicit this pointer, so when used from C++ libcurl's callback fn's need to be defined as static . From what I understand, using the static qualifier turns a C++ member variable/function into one 'owned' by the class rather than an instance of that class (or probably something that the compiler sticks outside of the name-mangled mess of all the instances), which in turn removes the need for a this pointer.
So far so good.
My initial solution was to use a few (evil) global variables (why are they evil? they work and don't cause headaches). But when I move those globals into the class definition as static members, I get:
Code: Select all
ld32: ERROR 33 : Unresolved data symbol "FTP::_state" -- 1st referenced by FTP.o.
on each of the variables I moved into the class definition. However, the staticly defined class-method callback functions have been working from the beginning.
What am I missing here?
J.
redbox
800Mhz 4Gb V12