"expected primary-expression before..." errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roughly stated, what do these mean? The first three errors in some
code I have are as follows:

    vp_sqlite2_init.cpp:16: error: expected primary-expression before '[' token
    vp_sqlite2_init.cpp:27: error: expected primary-expression before '[' token
    vp_sqlite2_init.cpp:37: error: expected primary-expression before '[' token

I'm assuming I'm missing some C++ rule that I am not familiar with,
but I don't know which one, and I can't find any information I can
make sense of from this. I've tried declaring the variables as extern
in the "vp_sqlite2_init.hh" file, and without declaring them, neither
of which has fixed the issue.

Thanks,
-Jim Stapleton

The lines of code are here (the lines starting with ">" reference the
erroneous lines):


#include "vp_sqlite2.hh"
#include "vp_sqlite2_init.hh"

#ifdef DEBUG
#include <stdio.h>
#endif

#define VPI_CREATE_SQL    1
#define VPI_CHECK_SQL     2
#define VPI_COLS          3
#define VPI_DROP_SQL      4


//virtual ports directory structure
char *vpd[]=
>["CREATE TABLE vpd (\n"
 "  dir    TEXT NOT NULL,\n"
 "  actual TEXT NOT NULL,\n"
 "  PRIMARY KEY(id)"
 ");\n"
 "CREATE INDEX vpd_ind ON vpd(dir);", //primary search, dir
 "SELECT sql FROM sqlite_master WHERE name='vpd';",
 "dir\0actual",
 "DROP TABLE vpd;"]; //dir will contain the whole directory - I don't
*like* SQLites
                     //non-typing insertion rules, but I'm not above
abusing them either.
char **cla=
>["CREATE TABLE cla(\n"
 "  classification  TEXT  NOT NULL\n"
 "  actual          TEXT NOT NULL\n"
 "  PRIMARY KEY(classification, actual)\n"
 ");\n"
 "CREATE INDEX cla_ind ON cla(classification);", //primary search:
classification
 "SELECT sql FROM sqlite_master WHERE name='cla';",
 "classification\0actual",
 "DROP TABLE cla"];
char **vpdl=
>["CREATE TABLE vpdl(\n"
 "   directory   TEXT NOT NULL,\n"
 "   description TEXT NOT NULL,\n"
 "   PRIMARY KEY(directory)\n"
 ");",
 "SELECT sql FROM sqlite_master WHERE name='vpdl';",
 "directory\0description",
 "DROP TABLE vpdl"];

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux