goto, really?? No wonder you're having problems.the very first thing it does is attempt to load the dll then reports it is going to try the API, then it checks the handle and reports failue in the event of a NULL handle and skips the rest of the code via a goto statement,
By the way I would be careful about returning a negative value from main(), I would stick with positive values that can be represented by an unsigned char when working with gcc (not sure about Visual C).