[mingw - Windows API] RE: Solution discovered, but not the "why"!

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[mingw - Windows API] RE: Solution discovered, but not the "why"!

SourceForge.net

Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3213609
By: dessent

Because that's how gcc is designed.  It processes the objects in the order specified.
If it processes libwinitnet.a before it's seen your ftp.o it will have no idea
that your code needs to link against InternetOpen and friends, so it will discard
all the objects in libwininet.a that are not referenced, which will be just
about everything.  If you do it the other way around, it will see the references
to the functions in ftp.o first and then be able to resolve them in
libwininet.a.

By the way you might want to consider calling all the functions without the
-A.  InternetOpen(), InternetConnect(), etc.  They will map to the -A variants
by default anyway, unless you #define UNICODE.  Doing it that way makes the
code cleaner and it means that if you ever do decide to support unicde in the
future you don't have to make a million changes.  I don't think microsoft ever
intended you to actually put the -A or -W version of the function in your source
code, that's all handled by the headers.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=286641


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users