Fatal Error Postgresql/libpq-fe.h No Such File Or Directory
Contents |
8.1 / 8.2 / 8.3 / 8.4 / 9.0 PostgreSQL 9.1.23 Documentation Prev Up Chapter 31. libpq - C Library Next 31.19. Building libpq Programs To build (i.e., compile and can't find the 'libpq-fe.h header ubuntu link) a program using libpq you need to do all of the following things:
Can't Find The 'libpq-fe.h Header Centos
Include the libpq-fe.h header file: #include
Psycopg2 Libpq-fe.h: No Such File Or Directory
then add the option to the CPPFLAGS variable: CPPFLAGS += -I/usr/local/pgsql/include If there is any chance that your program might be compiled by other users then you should not hardcode the directory location like that. Instead, you can run the utility pg_config to find out where the header files are on the local system: $ pg_config --includedir /usr/local/include Failure to specify the correct option to the compiler will result in an error message such as: testlibpq.c:8:22: libpq-fe.h: No such file or directory When linking the final program, specify the option -lpq so that the libpq library gets pulled in, as well as the option -Ldirectory to point the compiler to the directory where the libpq library resides. (Again, the compiler will search some directories by default.) For maximum portability, put the -L option before the -lpq option. For example: cc -o testprog testprog1.o testprog2.o -L/usr/local/pgsql/lib -lpq You can find out the library directory using pg_config as well: $ pg_config --libdir /usr/local/pgsql/lib Error messages that point to problems in this area could look like the following: testlibpq.o: In function `main': testlibpq.o(.text+0x60): undefined reference to `PQsetdbLogin' testlibpq.o(.text+0x71): undefined reference to `PQstatus' testlibpq.o(.text+0xa4): undefined reference to `PQerrorMessage' This means you forgot -lpq. /usr/bin/ld: cannot find -lpq This means you forgot the -L option or did
here for a quick overview of the site Help Center Detailed libpq-fe.h download answers to any questions you might have Meta Discuss can't find the 'libpq-fe.h header mac the workings and policies of this site About Us Learn more about Stack Overflow the
Libpq-fe.h R
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss https://www.postgresql.org/docs/9.1/static/libpq-build.html Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Can't find the 'libpq-fe.h header when trying to install pg gem up vote 465 down vote favorite 93 I am http://stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-pg-gem using rails 3.1 pre version. I like to use PostgreSQL but the problem is installing the pg gem. It gives me the following error: demonchand@system-001:~/exercise/personal/pro$ gem install pg Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/demonchand/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/demonchand/.rvm/rubies/ruby-1.9.2-p0/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config Gem files will remain installed in /home/demonchand/.rvm/gems/ruby-1.9.2-p0/gems/pg-0.11.0 for inspection. Results logged to /home/d
Edit Fix Released Medium MOTU Edit You need https://bugs.launchpad.net/bugs/316 to log in to change this bug's status. Affecting: libpqxx (Ubuntu) Filed here by: Paolo Borelli When: 2005-04-05 Assigned: 2005-04-05 Completed: https://ubuntuforums.org/showthread.php?t=1724906 2005-09-27 Target Distribution Baltix BOSS Juju Charms Collection Elbuntu Guadalinex Guadalinex Edu Kiwi Linux nUbuntu PLD Linux Tilix tuXlab Ubuntu Ubuntu no such Linaro Evaluation Build Ubuntu RTM Package (Find…) Project (Find…) Status Importance Fix Released Medium Assigned to Me MOTU (motu) Comment on this change (optional) Email me about changes to this bug report Also affects project (?) Also affects distribution/package Nominate for series Bug no such file Description I'm trying to compile a program which uses libpqxx, but the compile is failing with the following error: In file included from /usr/include/pqxx/util:21, from /usr/include/pqxx/except.hxx:22, from /usr/include/pqxx/except:22, from /usr/include/pqxx/connection_base.hxx... I'm trying to compile a program which uses libpqxx, but the compile is failing with the following error: In file included from /usr/include/pqxx/util:21, from /usr/include/pqxx/except.hxx:22, from /usr/include/pqxx/except:22, from /usr/include/pqxx/connection_base.hxx:27, from /usr/include/pqxx/connection_base:22, from /usr/include/pqxx/connection.hxx:19, from /usr/include/pqxx/connection:22, from /usr/include/pqxx/pqxx:17, from ../lib/powerlib/pgsqllibrary.h:27, from test.cpp:19: /usr/include/pqxx/util.hxx:60:22: libpq-fe.h: No such file or directory which seems to be due to a problem in the package: it looks for libpq-fe.h in the wrong place See original description Add tags Tag help Oliver Grawert (ogra) wrote on 2005-04-10: #1 libpq-fe.h is in the postgresql-dev package. Paolo Borelli (pborelli) wrote on 2005-04-10: #2 paol
Get Kubuntu Get Xubuntu Get Lubuntu Get UbuntuStudio Get Mythbuntu Get Edubuntu Get Ubuntu-GNOME Get UbuntuKylin Ubuntu Code of Conduct Ubuntu Wiki Community Wiki Other Support Launchpad Answers Ubuntu IRC Support AskUbuntu Official Documentation User Documentation Social Media Facebook Twitter Useful Links Distrowatch Bugs: Ubuntu PPAs: Ubuntu Web Upd8: Ubuntu OMG! Ubuntu Ubuntu Insights Planet Ubuntu Activity Page Please read before SSO login Advanced Search Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Packaging and Compiling Programs [SOLVED] gforth include file problem Having an Issue With Posting ? Do you want to help us debug the posting issues ? < is the place to report it, thanks ! Results 1 to 4 of 4 Thread: gforth include file problem Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode April 9th, 2011 #1 robotz421 View Profile View Forum Posts Private Message 5 Cups of Ubuntu Join Date Jan 2011 Beans 35 gforth include file problem I am using gforth and am trying to use postgreSQL. I have the following code: Code: \c #include