Created a project in eclipse Juno Hello World Autotools C ++ Project. Removed an unnecessary part from it and inserted its program into it.

#include <iostream> //using namespace std; #include <stdio.h> #include <postgresql/libpq-fe.h> #include <string> #include <cstdio> #include <stdlib.h> #include <libc.h> int main() { PGconn *conn; PGresult *res; int rec_count; int row; int col; FILE *stream; conn = PQconnectdb("hostaddr=192.168.143.93 port=5432 connect_timeout=5 dbname=NexentaSearch user=DKOI password=21111991"); if (PQstatus(conn) == CONNECTION_BAD) { puts("Не удается подключиться к базе данных"); exit(0); } res = PQexec(conn, "select path from paths order by id"); if (PQresultStatus(res) != PGRES_TUPLES_OK) { printf("Мы не получили данные"); exit(0); } rec_count = PQntuples(res); printf("Мы получили %d записей.\n", rec_count); puts("=========================="); stream=fopen("usr/local/ paths.txt ", "w"); for (row=0; row<rec_count; row++) { for (col=0; col<1; col++) { fprintf(stream, "%s\n", PQgetvalue(res, row, col)); } puts(""); } puts("=========================="); PQclear(res); PQfinish(conn); return 0; 

}

When compiling (clicking on a hammer, Build 'Build (GNU)' for project readwritepaths) produces the following errors:

Error 127 occurred while running autoreconf readwritepaths -1 Configure Problem

Programg g ++ not found in PATH readwritepaths

Programg gcc not found in PATH readwritepaths

  • @ ivan31, To format a code, select it with the mouse and click on the button 101010 of the editor. - dzhioev
  • gcc and g ++ installed? If not, install! - gecube
  • How to install gcc and g ++ on Windows? - ivan89
  • one
    Download MinGW, list MinGW \ bin in PATH. - avp
  • And where does Linux in tags? - gecube

1 answer 1

First, install the g ++ / gcc compilers. Then in the eclipse you need to register the paths to the compilers.

  • @ Re1aps through which menu items in eclipse Juno need to prescribe the path? - ivan89