Go Back   The macosxhints Forums > Working with OS X > OS X Developer



 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 08-04-2007, 06:59 PM   #1
stuudent
Prospect
 
Join Date: Aug 2007
Posts: 18
Red face newbie Q: why doesn't this build in Xcode?

The code below fails utterly in Xcode. Obviously, I'm new to Xcode.

Have checked all the build options. Turned off ZeroLink. Set paths for postgresql82 header and library. Set custom linker option -lpq.
Code:
// main.c
#include <libpq-fe.h>
int main (int argc, char * const argv[]) {
	PGconn *conn = PQconnectdb(NULL);
	PQfinish(conn);	
	return 0;
}
But same file compiles and links fine in gcc!
gcc -Wall -I/opt/local/include/postgresql82 -L/opt/local/lib/postgresql82 main.c -lpq -o hello

What gives?

-- stuudent

Last edited by hayne; 08-04-2007 at 09:17 PM. Reason: added CODE tags
stuudent is offline   Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:44 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Site design © Mac Publishing LLC; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of Mac Publishing LLC.