LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-18-2020, 10:46 AM   #1
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Rep: Reputation: 2
undefined reference to variable name `Conn::field'


hi to all, I've centos 7 and codeblocks 17 in VM. I am trying to build a program in which i am accessing MySQL database from c++ 11 .
In this following program :-

product.h :-
------------
Code:
#ifndef PRODUCT_H
#define PRODUCT_H

#include <mysql/my_global.h>
#include <mysql/my_sys.h>
#include <mysql/mysql.h>
#include "draw.h"
#include "stat.h"
class product
{
    public:
        product();
        virtual ~product();
        product(const product& other);
        product& operator=(const product& other);

        void showAllProduct();

        void printDashes(MYSQL_RES * resset);
        static void printError(MYSQL *conn, char * message);
};

#endif // PRODUCT_H
product.cpp:-

Code:
#include "product.h"
#include <string>
#include "stat.h"

using std::string;
using std::cout;
using std::cin;
using std::endl;

class Conn;

product::product()
{
    //ctor
}

product::~product()
{
    //dtor
}

product::product(const product& other)
{
    //copy ctor
}

product& product::operator=(const product& rhs)
{
    if (this == &rhs) return *this; // handle self assignment
    //assignment operator
    return *this;
}

void product::printDashes(MYSQL_RES * resset)
{
    unsigned int i, j;

    mysql_field_seek(resset, 0);
    clrscr();
    cout << "+";

    for(i = 0; i < mysql_num_fields(resset); i++)
    {
        Conn::field = mysql_fetch_field(resset);
        for(j = 0; j < Conn::field->max_length + 2; j++ )
        {
            cout << "-";
        }
        cout << "+";
    }
    cout << endl;
}

void product::showAllProduct()
{

    MYSQL * conn = Conn::connection();

    cout << " inside show all produucts";
    cin.get();
     char choose;
     clrscr();
     drawrect();
    int l = 5;
    gotoxy(15, 5);

    cout << "Welcome To Electronic Store";
    cin.get();
    gotoxy(15, 6);
    cout << "Show All Items Menu";

    cin.get();

    string strQuery = "select *from tableProductRecords";

    cout << strQuery << endl;

    int qState = mysql_query(conn, strQuery.c_str());

    cout << " before mysql_query " <<endl;

    cout << " After qstate " <<endl;
        if(qState == 0 )
        {
            cout << "in side qState " << endl;
            Conn::res = mysql_store_result(conn);

            cout << "after resuslt set ";

            mysql_field_seek(Conn::res, 0);

            while((Conn::row = mysql_fetch_row(Conn::res))!= nullptr )
            {
                printDashes(Conn::res);
            }
        }
        else
        {
            cout << " error : " << "  "<< mysql_errno(conn) << "  " << endl;

        }
    cin.get();
}
stat.h is :-

Code:
#ifndef STAT_H_INCLUDED
#define STAT_H_INCLUDED

#include <mysql/my_global.h>
#include <mysql/my_sys.h>
#include <mysql/mysql.h>
#include "draw.h"
#include "getchoice.h"
#include "product.h"
#include <iostream>

using std::cout;
using std::endl;

char * menu[] ={
    "1.  Show All Products",
    "2.  Add New Product.",
    "3.  Add New Members.",
    "4.  View An Existing Product Records.",
    "5.  View An Existing Member's Record.",
    "6.  Billing.",
    "7.  Today's Sail.",
    "8.  Modify Product Record.",
    "9.  Modify Member's Record.",
    "10. Instructions.",
    "11. Exit.",
    NULL
};

    static char *opt_host = "serverora11gr2.db.net";
    static char *opt_user_name = "rahul";
    static char *opt_password = "rahul";
    static unsigned int  opt_port = 3306;
    static char *opt_socket_name = NULL;
    static char *opt_db_nme = "cbs";
    static unsigned int opt_flags = 0;


class   Conn
{
public:
    static MYSQL *conn, mysql;
    static int qstate;
    static MYSQL_ROW row;
    static MYSQL_RES* res;
    static MYSQL_FIELD *field;

    static MYSQL* connection();
    static void printError(MYSQL *conn, char * message);

};




#endif // STAT_H_INCLUDED
stat.cpp:-
Code:
#include "stat.h"

static void printError(MYSQL *conn, char * message)
{
    gotoxy(15, 18);
    cout << *message;

    if(conn != NULL)
    {
        gotoxy(15, 19);
        cout << "Error is : " << mysql_errno(conn) << "  " << mysql_sqlstate(conn) << "  "<< mysql_error(conn);
    }
}


MYSQL * Conn::connection()
{
    if(mysql_library_init(0,NULL, NULL))
    {
        cout << "mysql lib init " << endl;
        exit(1);
    }

    conn = mysql_init(NULL);
    if(conn == NULL)
    {
        cout<< "conn is NULL";
        //cin.get();
        exit(2);
    }

    conn = mysql_real_connect (&mysql,"serverora11gr2.db.net","rahul","rahul","cbs",3306,NULL,0);
    return conn;
}
problem is that it showing following errors :-

Code:
-------------- Build: Release in cbs (compiler: GNU GCC Compiler)---------------

g++ -L/usr/lib64/mysql -o bin/Release/cbs obj/Release/draw.o obj/Release/getchoice.o obj/Release/main.o obj/Release/product.o obj/Release/stat.o  -s -m64  -lmysqlclient -lmysqlclient_r
obj/Release/product.o:(.data+0x0): multiple definition of `menu'
obj/Release/main.o:(.data+0x0): first defined here
obj/Release/stat.o:(.data+0x0): multiple definition of `menu'
obj/Release/main.o:(.data+0x0): first defined here
obj/Release/product.o: In function `product::printDashes(st_mysql_res*)':
product.cpp:(.text+0xa2): undefined reference to `Conn::field'
product.cpp:(.text+0xc7): undefined reference to `Conn::field'
obj/Release/product.o: In function `product::showAllProduct()':
product.cpp:(.text+0x383): undefined reference to `Conn::res'
product.cpp:(.text+0x38f): undefined reference to `Conn::res'
product.cpp:(.text+0x3a3): undefined reference to `Conn::res'
product.cpp:(.text+0x3b2): undefined reference to `Conn::res'
product.cpp:(.text+0x3c1): undefined reference to `Conn::row'
obj/Release/stat.o: In function `Conn::connection()':
stat.cpp:(.text+0x5): undefined reference to `Conn::mysql'
stat.cpp:(.text+0x2a): undefined reference to `Conn::conn'
stat.cpp:(.text+0x5b): undefined reference to `Conn::mysql'
stat.cpp:(.text+0x67): undefined reference to `Conn::conn'
collect2: error: ld returned 1 exit status
how to recover that.
 
Old 04-18-2020, 02:06 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Exactly where is Conn::field defined in your source? (Or, alternatively, here is a simpler question: what is the difference between declaration and definition?)
 
1 members found this post helpful.
Old 04-19-2020, 02:50 AM   #3
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
here is class in product.h
Quote:
class Conn
{
public:
static MYSQL *conn, mysql;
static int qstate;
static MYSQL_ROW row;
static MYSQL_RES* res;
static MYSQL_FIELD *field;

static MYSQL* connection();
static void printError(MYSQL *conn, char * message);

};
 
1 members found this post helpful.
Old 04-19-2020, 03:21 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Excellent. Now I would like to ask another question: exactly where is Conn::field defined in your source? (Or, alternatively, here is a simpler question: what is the difference between declaration and definition?)
 
1 members found this post helpful.
Old 04-19-2020, 03:28 AM   #5
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
here in product.cpp
Code:
void product::printDashes(MYSQL_RES * resset)
{
    unsigned int i, j;

    mysql_field_seek(resset, 0);
    clrscr();
    cout << "+";

    for(i = 0; i < mysql_num_fields(resset); i++)
    {
        Conn::field = mysql_fetch_field(resset);
        for(j = 0; j < Conn::field->max_length + 2; j++ )
        {
            cout << "-";
        }
        cout << "+";
    }
    cout << endl;
}
 
1 members found this post helpful.
Old 04-19-2020, 06:20 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Most impressive. Now I would like to ask another question: exactly where is Conn::field defined in your source? (Or, alternatively, here is a simpler question: what is the difference between declaration and definition?)
 
1 members found this post helpful.
Old 04-19-2020, 12:15 PM   #7
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
here is mine header file :-
Code:
#ifndef STAT_H_INCLUDED
#define STAT_H_INCLUDED

#include <mysql/my_global.h>
#include <mysql/my_sys.h>
#include <mysql/mysql.h>
#include "draw.h"
#include "getchoice.h"
#include "product.h"
#include <iostream>

using std::cout;
using std::endl;

char * menu[] ={
    "1.  Show All Products",
    "2.  Add New Product.",
    "3.  Add New Members.",
    "4.  View An Existing Product Records.",
    "5.  View An Existing Member's Record.",
    "6.  Billing.",
    "7.  Today's Sail.",
    "8.  Modify Product Record.",
    "9.  Modify Member's Record.",
    "10. Instructions.",
    "11. Exit.",
    NULL
};

    static char *opt_host = "serverora11gr2.db.net";
    static char *opt_user_name = "rahul";
    static char *opt_password = "rahul";
    static unsigned int  opt_port = 3306;
    static char *opt_socket_name = NULL;
    static char *opt_db_nme = "cbs";
    static unsigned int opt_flags = 0;


class Conn
{
public:
    static MYSQL *conn;
    static MYSQL mysql;
    static int qstate;
    static MYSQL_ROW row;
    static MYSQL_RES* res;
    static MYSQL_FIELD *field;

    static MYSQL* connection();
    static void printError(MYSQL *conn, char * message);

};
#endif // STAT_H_INCLUDED
and Con::field is defind here ( in stat.cpp ):-

Code:
#include <mysql/my_global.h>

#include "stat.h"

    Conn::conn = Conn::connection();
    Conn::mysql = NULL;
    Conn::qstate = 0;
    Conn::row = 0;
    Conn::res = nullptr;
    Conn::field = nullptr;

MYSQL * Conn::connection()
{
    //MY_INIT(argv[0]);

     //
     mysql_init(&mysql);

    if(mysql_library_init(0,NULL, NULL))
    {
        cout << "mysql lib init " << endl;
        exit(1);
    }

    conn = mysql_init(NULL);
    if(conn == NULL)
    {
        cout<< "conn is NULL";
        //cin.get();
        exit(2);
    }

    conn = mysql_real_connect (&mysql,"serverora11gr2.db.net","rahul","rahul","cbs",3306,NULL,0);
    return conn;
}


void Conn::printError(MYSQL *conn, char * message)
{
    gotoxy(15, 18);
    cout << *message;

    if(conn != NULL)
    {
        gotoxy(15, 19);
        cout << "Error is : " << mysql_errno(conn) << "  " << mysql_sqlstate(conn) << "  "<< mysql_error(conn);
    }
}
but now suddenly another problems arised :-

Code:
||=== Build: Release in cbs (compiler: GNU GCC Compiler) ===|
/usr/include/mysql/mysql/psi/psi.h|40|error: #error "You must include my_global.h in the code for the build to be correct."|
/usr/include/mysql/mysql/psi/psi.h|40|error: #error "You must include my_global.h in the code for the build to be correct."|
/usr/include/c++/4.8.2/bits/stl_algobase.h|239|error: macro "min" passed 3 arguments, but takes just 2|
/usr/include/c++/4.8.2/bits/stl_algobase.h|260|error: macro "max" passed 3 arguments, but takes just 2|
/usr/include/mysql/mysql/psi/mysql_thread.h||In function ‘int inline_mysql_cond_wait(mysql_cond_t*, mysql_mutex_t*, const char*, uint)’:|
/usr/include/mysql/mysql/psi/mysql_thread.h|1151|error: ‘my_cond_wait’ was not declared in this scope|
/usr/include/mysql/mysql/psi/mysql_thread.h|1162|error: ‘my_cond_wait’ was not declared in this scope|
/usr/include/mysql/mysql/psi/mysql_thread.h||In function ‘int inline_mysql_cond_timedwait(mysql_cond_t*, mysql_mutex_t*, const timespec*, const char*, uint)’:|
/usr/include/mysql/mysql/psi/mysql_thread.h|1188|error: ‘my_cond_timedwait’ was not declared in this scope|
/usr/include/mysql/mysql/psi/mysql_thread.h|1199|error: ‘my_cond_timedwait’ was not declared in this scope|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected unqualified-id before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected initializer before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected unqualified-id before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected initializer before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|239|error: ‘std::min’ declared as an ‘inline’ variable|
/usr/include/c++/4.8.2/bits/stl_algobase.h|239|error: template declaration of ‘const _Tp& std::min’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|242|error: expected primary-expression before ‘if’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|242|error: expected ‘}’ before ‘if’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|244|error: expected unqualified-id before ‘return’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|260|error: ‘max’ declared as an ‘inline’ variable|
/usr/include/c++/4.8.2/bits/stl_algobase.h|260|error: template declaration of ‘const _Tp& max’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|263|error: expected primary-expression before ‘if’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|263|error: expected ‘}’ before ‘if’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|265|error: expected unqualified-id before ‘return’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|266|error: expected declaration before ‘}’ token|
/usr/include/mysql/mysql/psi/psi.h|40|error: #error "You must include my_global.h in the code for the build to be correct."|
/usr/include/c++/4.8.2/bits/stl_algobase.h|239|error: macro "min" passed 3 arguments, but takes just 2|
/usr/include/c++/4.8.2/bits/stl_algobase.h|260|error: macro "max" passed 3 arguments, but takes just 2|
/usr/include/mysql/mysql/psi/mysql_thread.h||In function ‘int inline_mysql_cond_wait(mysql_cond_t*, mysql_mutex_t*, const char*, uint)’:|
/usr/include/mysql/mysql/psi/mysql_thread.h|1151|error: ‘my_cond_wait’ was not declared in this scope|
/usr/include/mysql/mysql/psi/mysql_thread.h|1162|error: ‘my_cond_wait’ was not declared in this scope|
/usr/include/mysql/mysql/psi/mysql_thread.h||In function ‘int inline_mysql_cond_timedwait(mysql_cond_t*, mysql_mutex_t*, const timespec*, const char*, uint)’:|
/usr/include/mysql/mysql/psi/mysql_thread.h|1188|error: ‘my_cond_timedwait’ was not declared in this scope|
/usr/include/mysql/mysql/psi/mysql_thread.h|1199|error: ‘my_cond_timedwait’ was not declared in this scope|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected unqualified-id before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|193|error: expected initializer before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected unqualified-id before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected ‘)’ before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|216|error: expected initializer before ‘const’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|239|error: ‘std::min’ declared as an ‘inline’ variable|
/usr/include/c++/4.8.2/bits/stl_algobase.h|239|error: template declaration of ‘const _Tp& std::min’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|242|error: expected primary-expression before ‘if’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|242|error: expected ‘}’ before ‘if’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|244|error: expected unqualified-id before ‘return’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|260|error: ‘max’ declared as an ‘inline’ variable|
/usr/include/c++/4.8.2/bits/stl_algobase.h|260|error: template declaration of ‘const _Tp& max’|
/usr/include/c++/4.8.2/bits/stl_algobase.h|263|error: expected primary-expression before ‘if’|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
I already included "mysql/my_global.h" but even this problem arised.
 
Old 04-19-2020, 02:20 PM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Which file were you compiling when you got these error messages? (Note: I'm afraid you're using cmake, or an "IDE" or some other kind of "helping software".)
 
Old 04-20-2020, 12:18 AM   #9
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
I am using codeblocks IDE
 
Old 04-20-2020, 02:34 AM   #10
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,864
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Maybe you could find a way to compile source-files separately so that you could find out which one of your sources is problematic.
 
Old 04-20-2020, 10:12 AM   #11
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
How are you invoking your compiler? What mysql library are you using?

If you have mysql_config on your system, what is the output of the following commands.

mysql_config --cflags
mysql_config --libs

You appear to be dealing with a variety of problems at once. If you were to start with and get smaller issues resolved before add complexity it might help.
i.e. compile and run this:
Code:
#include <mysql.h>
#include <stdlib.h>

int main(void) {
  if (mysql_library_init(0, NULL, NULL)) {
    fprintf(stderr, "could not initialize MySQL client library\n");
    exit(1);
  }


  mysql_library_end();

  return EXIT_SUCCESS;
}
 
Old 04-21-2020, 03:49 AM   #12
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
output of mysql_config --cflags
mysql_config --libs
Code:
[rahul@centos7client Release]$ ./mysql_test 
[rahul@centos7client Release]$ mysql_config --cflags
-I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1
[rahul@centos7client Release]$ mysql_config --libs
-L/usr/lib64 -lmysqlclient -lpthread -lm -lrt -ldl
output of above program is : no output

and i included -lpthread -lm -lrt -ldl into project but same problem, please help.

Last edited by rahulvishwakarma; 04-21-2020 at 03:52 AM.
 
Old 04-21-2020, 07:48 AM   #13
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
One thing that jumps out is the sql includes. It looks like you should remove the first path element in them i.e change #include <sql/sql.h> to #include <sql.h>.

On the other hand, you could add pieces into the code you have that compiles - mysql_test - and build it up a piece at a time, making sure you understand what each piece does and making sure it compiles at each step.
 
Old 04-21-2020, 09:06 AM   #14
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
i did like this :-
Code:
#ifndef STAT_H_INCLUDED
#define STAT_H_INCLUDED

//#define MY_GLOBAL_INCLUDED
#include <my_global.h>
//#include <mysql/my_global.h>
#include <my_sys.h>
#include <mysql.h>
#include "draw.h"
#include "getchoice.h"
#include "product.h"
#include <iostream>


//using std::cout;
//using std::endl;

char * menu[] ={
    "1.  Show All Products",
    "2.  Add New Product.",
    "3.  Add New Members.",
    "4.  View An Existing Product Records.",
    "5.  View An Existing Member's Record.",
    "6.  Billing.",
    "7.  Today's Sail.",
    "8.  Modify Product Record.",
    "9.  Modify Member's Record.",
    "10. Instructions.",
    "11. Exit.",
    NULL
};

    static char *opt_host = "serverora11gr2.db.net";
    static char *opt_user_name = "rahul";
    static char *opt_password = "rahul";
    static unsigned int  opt_port = 3306;
    static char *opt_socket_name = NULL;
    static char *opt_db_nme = "cbs";
    static unsigned int opt_flags = 0;


class Conn
{
public:
    static MYSQL *conn;
    static MYSQL mysql;
    static int qstate;
    static MYSQL_ROW row;
    static MYSQL_RES* res;
    static MYSQL_FIELD *field;

    static MYSQL* connection();
    static void printError(MYSQL *conn, char * message);

};
#endif // STAT_H_INCLUDED
but having same problem. please any suggestion.

Last edited by rahulvishwakarma; 04-21-2020 at 11:52 AM.
 
Old 04-22-2020, 07:58 AM   #15
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
I'd suggest you follow my previous suggestion and start simple and build up so you can find what you're doing wrong.

If you want to keep bashing away at what you have you could answer these questions:

How does CodeBlocks create it's arguments for the build chain?

Where did you get the code your compiling? Did they have compilation instructions?
 
1 members found this post helpful.
  


Reply

Tags
c++, centos7



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Notice: Undefined index / Undefined variable in /var/log/httpd/error_log AdultFoundry Linux - Server 3 06-20-2016 06:06 PM
Undefined reference to 'function name' C vwinnecke Programming 11 04-09-2013 02:25 PM
problem while comparing awk field variable with input variable entered using keyboard vinay007 Programming 12 08-23-2011 12:44 AM
Problem with bash script - variable name within variable name steven.c.banks Linux - Newbie 3 03-10-2009 03:08 AM
"undefined reference"linker error for static field w/ C++ astorm Programming 5 08-27-2008 03:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration