Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » the application not starting 0xc000007b: postgresql
the application not starting 0xc000007b: postgresql [message #49539] |
Mon, 26 February 2018 00:48 |
|
Hi -
I am fooling around with postgresql 9.x today. I use mingw64.
I will include code: any idea why the error msg?
Its killing me. I have postgresql installed on win 10 home.
I got the msg to go away that said can't find libpq.
I made an adjustment in the postgresql.upp file :
library(WIN32 !NOPOSTGRESQL GCC) libpq;.
the code from my .exe upp file is :
uses
CtrlLib,
SqlCtrl,
PostgreSQL;
file
C:\cygwin64\home\mtdew\theide\upp\MyApps\pg\libpq-fe.h,
Postgres.h,
database.sch,
Postgres.lay,
main.cpp;
mainconfig
"" = "GUI";
I don't know how to get more info to diagnosis the problem!
If you see a glaring error, please assist! thx. -mtdew3q
#ifndef _Postgres_Postgres_h
#define _Postgres_Postgres_h
#include <CtrlLib/CtrlLib.h>
#include <SqlCtrl/SqlCtrl.h>
using namespace Upp;
#define LAYOUTFILE <pg/Postgres.lay>
#include <CtrlCore/lay.h>
#include <PostgreSQL/PostgreSQL.h>
#define SCHEMADIALECT <PostgreSQL/PostgreSQLSchema.h>
#define MODEL <pg/database.sch>
#include "Sql/sch_header.h"
// debian: sudo apt-get install libpq-dev
class PostgreSQLTest : public WithPostgreSQLTestLayout<TopWindow> {
public:
typedef PostgreSQLTest CLASSNAME;
PostgreSQLTest();
bool OpenDB();
bool InsertTestData();
void ShowTestData();
protected:
PostgreSQLSession m_session;
};
#endif
#include "Postgres.h"
#include <Sql/sch_schema.h>
#include <Sql/sch_source.h>
using namespace Upp;
PostgreSQLTest::PostgreSQLTest()
{
CtrlLayout(*this, "PostgreSQL Test");
m_refresh <<= THISBACK(ShowTestData);
m_array.SetTable(categories);
m_array.AddKey(category);
m_array.AddColumn(category, "category");
m_array.AddColumn(categoryname, "categoryname");
}
bool PostgreSQLTest::OpenDB()
{
if(!m_session.Open("host=localhost dbname=etack user=claudio password=HFi4Cm?@"))
{
Exclamation(Format("Error in open: %s", DeQtf(m_session.GetLastError())));
return false;
}
m_array.SetSession(m_session);
#ifdef _DEBUG
m_session.SetTrace();
#endif
SQL = m_session;
//schema
Progress p;
p.SetText(t_("Creating _DEBUG database"));
SqlSchema sch(PGSQL);
All_Tables(sch);
if(sch.ScriptChanged(SqlSchema::UPGRADE))
SqlPerformScript(sch.Upgrade(), p);
if(sch.ScriptChanged(SqlSchema::ATTRIBUTES)) {
SqlPerformScript(sch.Attributes(), p);
}
if(sch.ScriptChanged(SqlSchema::CONFIG)) {
SqlPerformScript(sch.ConfigDrop(), p);
SqlPerformScript(sch.Config(), p);
}
sch.SaveNormal();
return true;
}
bool PostgreSQLTest::InsertTestData()
{
/*
Sql sql(m_session);
sql.ClearError();
sql.Begin();
sql * Delete(TESTPARTNER);
sql * Insert(TESTPARTNER)
(TESTPARTNER_NAME, "First Partner")
(TESTPARTNER_ADDRESS, "First Street")
;
sql * Insert(TESTPARTNER)
(TESTPARTNER_NAME, "Second Partner")
(TESTPARTNER_ADDRESS, "Second Street")
;
sql * Insert(TESTPARTNER)
(TESTPARTNER_NAME, "Third Partner")
(TESTPARTNER_ADDRESS, "Third Street")
;
if(!OkCommit(m_session, "Unable to insert test data."))
return false;
*/
return true;
}
void PostgreSQLTest::ShowTestData()
{
// m_array.SetOrderBy(TESTPARTNER_NAME);
m_array.Query();
}
GUI_APP_MAIN
{
PostgreSQLTest dlg;
if(dlg.OpenDB() ){
dlg.ShowTestData();
dlg.Run();
}
}
LAYOUT(PostgreSQLTestLayout, 416, 348)
ITEM(SqlArray, m_array, HSizePosZ(8, 88).VSizePosZ(8, 8))
ITEM(Button, m_refresh, SetLabel(t_("Refresh")).Tip(t_("Refresh data in array")).RightPosZ(8, 72).TopPosZ(8, 24))
END_LAYOUT
TABLE_(categories)
INT_ (category) PRIMARY_KEY
STRING_ (categoryname, 50)
END_TABLE
|
|
|
Goto Forum:
Current Time: Tue Apr 23 08:03:55 CEST 2024
Total time taken to generate the page: 0.02040 seconds
|