About Store Forum Documentation Contact



Post Reply 
[Solved] EE 2.0 Doesn't want to parse a header
Author Message
Houge Offline
Member

Post: #1
[Solved] EE 2.0 Doesn't want to parse a header
Hello!

I faced the problem: I installed PostgreSQL 9.3 and i'm trying to use it's header in EE 2.0. I include full header path - "C:\PostgreSQL\9.3\include\libpq-fe.h" but there are no classes in autocomplete system. Nevertheless it builds and works.
(This post was last modified: 03-12-2014 06:09 AM by Houge.)
02-26-2014 05:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #2
RE: EE 2.0 Doesn't want to parse a header
UP, it prevents me from creation a functions with return variable types from this header, like
Code:
PGconn* DatabaseConnection(PGconn *conn, Str user, Str pwd)
{
    conn = PQconnectdb(Str8("user=user password=1 dbname=db hostaddr=127.0.0.1 port=5432"));
  
    if (PQstatus(conn) != CONNECTION_OK)
    {
       Gui.msgBox("Error connecting to DB!", S+PQstatus(conn));
       return NULL;
    }
    
    return conn;
}

Interesting thing: if i create such code it is replaced by EE with the following when building:
Code:
/******************************************************************************/
// VARIABLES
/******************************************************************************/
extern PGconn* DatabaseConnection(PGconn *conn, Str user, Str pwd)
{
    conn = PQconnectdb(Str8(L"user=user password=1 dbname=db hostaddr=127.0.0.1 port=5432"));
/******************************************************************************/
// FUNCTIONS
/******************************************************************************/

so VS stops compilation. But if i use it like that:
Code:
PGconn* DatabaseConnection(PGconn *conn)
{
    conn = PQconnectdb(Str8("user=user password=1 dbname=db hostaddr=127.0.0.1 port=5432"));
  
    if (PQstatus(conn) != CONNECTION_OK)
    {
       Gui.msgBox("Error connecting to DB!", S+PQstatus(conn));
       return NULL;
    }
    
    return conn;
}
Everything is ok.
02-28-2014 06:05 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #3
RE: EE 2.0 Doesn't want to parse a header
UP! Greg! I found the reason:
At header start there is a line
Code:
extern      "C"
{
... all the code ...
}

If i remove it, then header is parsed, but of course it doesn't compile smile
Can you do sonething with it?
03-02-2014 02:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: EE 2.0 Doesn't want to parse a header
Thanks, I'll investigate it.
Could you also let me know why are you using PostgreSQL ? Are there any advantages in using it instead of builtin MS SQL, MySQL, SQLite?
Thanks
03-02-2014 08:55 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: EE 2.0 Doesn't want to parse a header
Next release will have this feature:
-added support for parsing headers with 'extern "C"'
03-02-2014 11:51 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #6
RE: EE 2.0 Doesn't want to parse a header
(03-02-2014 11:51 PM)Esenthel Wrote:  Next release will have this feature:
-added support for parsing headers with 'extern "C"'

Thanks a lot!!!

(03-02-2014 08:55 PM)Esenthel Wrote:  Thanks, I'll investigate it.
Could you also let me know why are you using PostgreSQL ? Are there any advantages in using it instead of builtin MS SQL, MySQL, SQLite?
Thanks

PostgreSQL vs MS SQL:
It's free and can be installed to Linux server

PostgreSQL vs MySQL:
You can use stored procedures, cursors, functional indexes, regular expressions and more. MySQL is more famous and PostgreSQL is much more powerful.

PostgreSQL vs SQLite:
They are in different weight categories smile

PostgreSQL is like a free version of Oracle without analytic functionality. Frankly speaking I wanted to use Oracle, but it is too expensive (40k$ per processor core is too much) so PostgreSQL is the best alternative.
(This post was last modified: 03-03-2014 06:19 AM by Houge.)
03-03-2014 04:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #7
RE: [Solved] EE 2.0 Doesn't want to parse a header
Thanks, Greg!
After today's release everything works great!
03-12-2014 06:10 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: [Solved] EE 2.0 Doesn't want to parse a header
Thanks for letting me know!
03-12-2014 06:12 AM
Find all posts by this user Quote this message in a reply
Post Reply