Not sure if this is your problem but it's a problem I have found in the past. The compiler will by default, put the object file in the current working directory, not necessarily the same directory...
Does anyone know if there is a C API call to get the status of a TCP port? As opposed to running netstat and parsing the results. At the moment I have to attempt to bind() and pick up on the address...