Win7 32 codelite c++ mysql

General questions regarding the usage of CodeLite
fender0107401
CodeLite Curious
Posts: 4
Joined: Tue Dec 09, 2014 3:45 pm
Genuine User: Yes
IDE Question: C++
Contact:

Win7 32 codelite c++ mysql

Post 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?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Win7 32 codelite c++ mysql

Post by eranif »

This is not related to CodeLite.
Please search on C++/MySQL forums. This forum only deals with CodeLite related issues

Eran
Make sure you have read the HOW TO POST thread
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Win7 32 codelite c++ mysql

Post 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
User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Win7 32 codelite c++ mysql

Post 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.
Post Reply