Solved

Using log4c logging tool in a C project

Posted on 2013-11-15
3
853 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now