Page 1 of 1

Win7 32 codelite c++ mysql

Posted: Sun Dec 14, 2014 2:44 pm
by fender0107401
Hi all:

I am trying to write C++ with codelite in Win7 environment. I need to connect mysql database and postgresql.

After yahoo (I live in China, so google is so far away from us), I didn't find too many useful information.

I have tried this: http://dev.mysql.com/downloads/connector/cpp/ but it doesn't work.

To complie, I have to edit config.h,

Code: Select all

#ifdef HAVE_MS_INT32
//typedef __int32			int32_t;
#endif

#ifdef HAVE_MS_UINT32
//typedef unsigned __int32	uint32_t;
#endif
and even after that it give me this:


C:/local/mysql/include/mysql_driver.h:89: undefined reference to `_imp___ZN3sql5mysql19get_driver_instanceEv'




So, can some give me some tips?

Re: Win7 32 codelite c++ mysql

Posted: Sun Dec 14, 2014 3:21 pm
by eranif
This is not related to CodeLite.
Please search on C++/MySQL forums. This forum only deals with CodeLite related issues

Eran

Re: Win7 32 codelite c++ mysql

Posted: Tue Dec 16, 2014 2:44 am
by Gibbon1
Just a few pointers. You probably need to tell codelite to pass the correct defines to the preprocessor.

See workspace->settings->common settings-> compiler -> preprossesor

And you need to configure your project settings in codelite to tell the linker where to look for the correct libraries to link, and those libraries need to be 1. present 2. the correct version, 3. compiled by the same C++ compiler you are using.

See workspace -> settings -> linker

Re: Win7 32 codelite c++ mysql

Posted: Tue Dec 16, 2014 12:08 pm
by Jarod42
Make sure that your lib are for MinGW gcc (or the compiler you use) or else you have to compile from source.

In project Settings...:
- Add include Paths in compiler options (and maybe pre-processor definition)
- Add library search path and library in linker options.