I have earned. Of course, gcc requires some additional parameters to communicate with ASIHTTP modules. Here is what I ended up with:
-std=c99 -framework SystemConfiguration -framework CoreServices -framework Foundation -lz -I/path/to/asi-header-files -filelist /path/to/list-of-asi-compiled-modules
I assume that your code simply included paths to ASIHTTPRequest.h header files, etc ... if you use explicit paths there, you don't need the -I switch above. gcc must have a compiled version of the code from ASIHTTPRequest.m and friends in order to link to it. One way to do this is to compile the "Mac" project that comes with the library. This will create .o files in one of those deep-buried DerivedData directories that Xcode likes to do. The one he did for me is:
~/Library/Developer/Xcode/DerivedData/Mac-flsjygxmngizhzfwnfgcakejmwkx/Build/Intermediates/Mac.build/Debug/Mac.build/Objects-normal/x86_64
(I think the “Mac-flsjygxmngizhzfwnfgcakejmwkx” bit will be different for you.) There are many .o files and a “Mac.LinkFileList” file in this directory. This file is the one you specify for the -filelist option for gcc. You will need to remove the links to the main.o, AppDelegate.o and ASIWebPageRequest.o files so that you do not get duplicate characters during the link stage.
In addition to the ASIHTTPRequest headers and .o files, gcc will reference the SystemConfiguration infrastructure, CoreServices, and the zlib library, since ASIHTTPRequest has these dependencies.
If you conduct many tests with this library, I would recommend duplicating the definition of the language "Objective-C" (in the "Preferences" section) as "Objective-C with ASIHTTPRequest" or something else. You can then configure compilation flags to work with ASIHTTPRequest without doing this for all Objective-C code that you run.
You can also copy the .o files and the LinkFileList file to a more permanent location, just in case Xcode clears this assembly tree or something else.
source share