Solved

Using log4c logging tool in a C project

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Suggested Courses

628 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