Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using log4c logging tool in a C project

Posted on 2013-11-15
3
Medium Priority
?
962 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

Question has a verified solution.

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

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

715 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