Re: [anjuta-list] How to add libraries mysql over Anjuta



Hi,


On 21/10/2014 11:37, Massimiliano Di Cavio wrote:
Could you tell me how can I add library mysql over an anjuta project?
I'm able to do with g++ e gcc compiler (g++ -c `mysql_config --cflags`
Secondo.cpp    g++ -o prova1 Secondo.o `mysql_config --libs`) , but I
didn't find any solution for Anjuta. When I try to build I've a lot of
errors.

First, your project need to be an autotools project, it's the default project type.

Then you can select on Project->Add library->New Library. If your have installed the development package for mysql and that it contains a pkg-config file, it should appears in the list and you just have to select it, click Add and then select in the first dialog which target needs this library, typically your main program or library.


Now, this uses pkg_config and according to the command line in your mail, it's quite possible that mysql uses its own stuff mysql_config and doesn't provide the pkg-config file. In this case, the method above is not working and you have to use less user friendly method.

Again, it needs to be a autotools project. Then, you need to select the target needing these additional options, it can be a group (=a directory) containing all your sources files or the target (the library or an executable). Right click on it in the project pane, select property and fill the C compiler flags with `mysql_config --cflags`. If it doesn't appear you can have to click on more option expander first.


If your project doesn't use autotools, it's up to you to edit the makefile or whatever build file you use with a text editor. You can do that for autotoold build file too (Makefile.am) as Anjuta is able to parse them.


Regards,

Sébastien


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