Solved

Using log4c logging tool in a C project

Posted on 2013-11-15
3
877 Views
Last Modified: 2013-11-15
Hi Experts,
I am trying to use log4c in a C project.  The C app would be running in Linux(embedded).  I was thinking I can use log4c by simply copying the .so file and the header files into my project.  But, the documentation available everywhere points to installing it( apt-get install liblog4c-dev etc)

What are the steps required to use this?  I believe this is pretty much same for any other libs( like openssl)...  thank you.
0
Comment
Question by:ambuli
  • 2
3 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 39651439
To avoid installation, I'd try to statically link against log4c - this would save you all that hassle. You should be able to specify that either when running './configure' or edit the resulting Makefile to create a static library instead of a dynamic one.
0
 

Author Comment

by:ambuli
ID: 39651475
thanks.  So, I would just grab the liblog4c.a file and statically link.  How about the header files?
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 39651543
The headers aren't affected by that. As opposed to Windows, there's no 'dllexport' keyword for UN*X/Linux, all you have to do is changing the respective compiler and linker switches, i.e. removing the '-shared' switch from the gcc options and adapting the output filename to end with '.a'.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question