Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 995
  • Last Modified:

Using log4c logging tool in a C project

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
ambuli
Asked:
ambuli
  • 2
1 Solution
 
jkrCommented:
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
 
ambuliAuthor Commented:
thanks.  So, I would just grab the liblog4c.a file and statically link.  How about the header files?
0
 
jkrCommented:
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now