No clue about Applescript Studio. In Project Builder, choose "Add Frameworks" from the "Project" menu and select your shared library. That's it...
From the terminal, I think you would add the "-l <path to my library>" switch to your gcc invokation. (that's "dash el").