How to Install and run iniparser for Eclipse CDT? - c

I have been trying to find a way to install the iniparser library to write configuration files for C programs in eclipse, the whole day today. But I have not been able to find anything usefull. I am using Windows 7 (64 bit).
I have tried downloading the zip file and loading it into the 'lib' folders of eclipse. But when I try to include it into the C program it gives me a error saying 'iniparser.h' not found.
Can somebody PLEASE tell me how can I do this?? I would really be thankfull..

You can include path-
Try-
Project -> properties -> C/C++General -> Paths and Symbols -> Includes tab -> Assembly
while checking 'add to all languages'.
This one did not work for me- Project -> Properties -> C/C++General -> Paths and Symbols -> Includes tab -> GCC C

Related

To install library function for the header files with vcpkg

i am not able to install libraries for the headers with vcpkg for c
The following error was obtained when i had been writing up a c program in vs code
enter image description here
when checked it was showing to install library for the header.
any help in installing this library using vcpkg would be appreciable.
You are facing this problem because you have not installed the compiler properly.
Follow these steps,
Download and Install Mingw https://sourceforge.net/projects/mingw/
'Mingw Installation Manager' will pop up and you need to select 'mingw32-gcc-g++'->Right click -> Mark for Installation
3.Installation Menu -> Apply changes -> Apply
Now you have installed compiler in your PC but you need to VScode to where this compiler is located in your PC.
If you have used default settings then your compiler will be located in C:\MinGW\bin
Copy the path C:\MinGW\bin and Go to Advanced System settings -> Advanced Tab -> Environment Variables -> New -> paste path C:\MinGW\bin -> ok
Setup is done now you can run your code in VScode.

Eclipse CDT - C project

I'm new using Eclipse for programming in C.
I have several doubts and although I found a lot of questions related to it, by now I don't get to solve my problems.
I have a C project with several source files(.c), header files(.h), a Makefile and an archive library (.a). Until now, I have been editing my code with a editor (gedit) and I have been compiling it with the terminal. I run "make" on the terminal and several shared object libraries (.so) are generated and in addittion, an executable file.
Now, I want to use Eclipse with CDT to programme and compile the code. My first doubt is the type of project that I must choose:
Executable or Makefile project?
I selected the "Executable" type. Then I tried to build the project and I got a lot of errors due to "undefined references" and several error messages with "relocation x has invalid symbol index".
I did the following steps:
Properties -> C/C++ General -> Path and Symbols -> Includes -> GNU C -> Add -> Filesystem ->
I put the project folder, since the header files are in this folder (with absolute path). Then "Clean project" and "Build project". It didn't work, and I got the same errors
Later, I tried:
Properties -> C/C++ Build -> GCC C Linker -> Miscellaneous -> Other objects ->
I put the archive file (.a). Then "Clean project" and "Build project".
The previous problems didn't occur, but I got other "undefined references" with files related to the archive file and I can't access them.
I appreciate any help.
I'm sorry if someone already asked this question, but I searched a lot before I write it.
Thanks
I run "make" on the terminal and several shared object libraries (.so) are generated and in addittion, an executable file.
Each .so and each executable should be a separate project in your workspace.

linking libusb-1.0.9 to codeblocks in windows

I downloaded the libusb-1.0.9 library from the net but it doesnt have any .lib file. It has a .def file although. The error it is showing is "uninitialized reference to libusb_init" . There is a .lib file that needs to added to the linker properties in settings of the compiler but I haven't been able to fix it.
It would be of great help if someone could help me out.
Thanks
According to VS2008,
go to Project -> Project Properties -> Configuration -> Linker -> Input -> Additional dependency, put your .lib name in addition ascendancy. And also copy .lib file your project directory.
If you do not have libusb-1-0-9.lb file then you can download from Sourceforge.net
Have you tried reading the code::blocks documentation regarding "Using project dependencies"?

How to add a library to eclipse C project?

I need to add a C library to C project in Eclipse indigo.
What I've done so far.
I've downloaded and installed the library.
All headers are in folder /usr/include, library.so files are in folder /usr/lib.
After having read a tutorial I tried to do it like this:
When in Eclipse -> Project -> C/C++ Build -> Settings -> GCC C Linker -> Libaries -> Add libary -> "ibxml2" ( library name is libxml2 )
But it still doesn't work.
I am a super newbie at Linux, so please could you give me some advise how to do that?
By the way one more thing. After creating a new C/C++ Project when I run an error occurs " Launch failed! Binary not found". I checked "Binary Parsers" in Project's Settings and "Elf Parser" is set ( I've read that it is OK for Linux ), so what is wrong? It is not so important, since it works when I first only build project and then run it, but maybe there is a way to solve that too?
In linker options, you should not add "libxml2", but just "xml2". All binary libraries in Linux (so files) have a "lib" prefix that is not a part of library name.

undefined reference to pthread_create in c program on eclipse (Fedora)

I have a problem in building a c thread program. Program is giving error like
"undefined reference to pthread_creat".
I searched and found to use gcc options like
"gcc -lpthread -o ...."
But I not able to set it for eclipse. I tried to make change in makefile but every time it got replaced with default options. Please help me to set these gcc options and write about where and how to set gcc options in eclipse on fedora 10.
Thanks,
Lokesh
to add pthread library to your project flow these steps (in eclipse):
right cklick on the project in the project explorer -> properties -> c/c++ build -> Settings -> linker -> libraries -> add -> pthread -> ok -> rebuild
Check this 'tutorial' on about how to setup eclipse for developing posix threads.
Hope it helps.
To add pthread library to your non-makefile project, do following steps (in eclipse):
right click on the project in the project explorer. Select properties -> c/c++ general -> Paths and Symbols -> libraries -> add -> type 'pthread' in text box -> ok -> ok -> rebuild

Resources