I am trying to use a mex wrapper to connect the Matlab with PostgreSQL.
I have found the program at http://www.shivakar.com/programming/creating-matlab-mex-function-for-postgresql-database-connectivity/
I am getting following error while compiling it on MATLAB
>> mex -DWindows -IC:\PostgreSQL\pgsql\include -LC:\PostgreSQL\pgsql\lib -lpq libpqmex.c Writing library for libpqmex.mexw32 c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQconnectdb' c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQstatus' c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQexec' c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQntuples' c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQnfields' c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQerrorMessage' c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQfinish' c:\docume~1\asalman\locals~1\temp\mex_76~1\libpqmex.obj .text: undefined reference to '_PQgetvalue' C:\PROGRA~1\MATLAB\R2011A\BIN\MEX.PL: Error: Link of 'libpqmex.mexw32' failed.
Please help me.
Thanks in advance
Regards
Sumit
Best Answer