How do I include easily new libraries [message #721321] |
Thu, 01 September 2011 09:17  |
Eclipse User |
|
|
|
In Eclipse Indigo, I surf to Properties>>C/C++ Build>>Settings>>GCC C++ Linker >> Miscellaneous >> Other Options (-Xlinker [option]), and I typed -lcurl? I am new in C++ and I have used Eclipse only for Java until one month ago. I spent long hours to start using Boost and now I spent more time to start using Curl. And soon I will need to use log4cpp and some more libraries. I was just trying to do a simple example. Now I am able to include both libraries but I have no idea what I have done. I just followed some suggestions but it took me long hours trying other suggestions before, even from official site.
It would be nice if I understood how to add some libraries without lost hours. About Boost, I did a very different way. I surfed Properties>>C/C++ Build>>Settings>>GCC C++ Compiler >> Includes and I wrote /usr/local/boost_1_47_0/ and, later, /usr/local/curl-7.21.7/. I noted that, after this, I could hold control key and clicked on variable type that Eclipse would be guide to proper file.h from boost or curl. But I only get the build code after I surfed Properties>>C/C++ Build>>Settings>>GCC C++ Linker >> Libraries and I wrote on Libraries (-l) boost_system and boost_filesystem and, on Library Search Path (-L) I wrote /usr/local/boost_1_47_0/libs. Why I put -lcurl on Miscellaneous but, about boost, I put boost_system and boost_filesystem on Libraries? I tried follow similar way to curl as I did for boost, but it doens't work.
Thanks in advance,
Demetrio
|
|
|
|
|
|
Re: How do I include easily new libraries [message #990999 is a reply to message #734862] |
Sun, 16 December 2012 13:17  |
Eclipse User |
|
|
|
I was able to get it working by:
1. brew install mylibrary (headers went under /usr/local/include)
2. In Makefile "LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -lmylibary -o $@"
In step two, where would the correct place be to define used libary?
|
|
|
Powered by
FUDForum. Page generated in 0.03094 seconds