Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8184627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:34:17+00:00 2026-06-07T01:34:17+00:00

I am using apr in a C program, I am including the appr_error.h header

  • 0

I am using apr in a C program, I am including the appr_error.h header file, but I am getting an error during building:

In function ‘APR_DECLARE’: error: expected declaration specifiers
before ‘apr_strerror’

Here is the offending line in the header file:

 /**
  * Return a human readable string describing the specified error.
  * @param statcode The error code the get a string for.
  * @param buf A buffer to hold the error string.
  * @param bufsize Size of the buffer to hold the string.
  */
 APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, 
                                  apr_size_t bufsize);

This header file include a header file that has a #define for APR_DECLARE as follows:

#if !defined(WIN32)
368 /**
369  * The public APR functions are declared with APR_DECLARE(), so they may
370  * use the most appropriate calling convention.  Public APR functions with 
371  * variable arguments must use APR_DECLARE_NONSTD().
372  *
373  * @deffunc APR_DECLARE(rettype) apr_func(args);
374  */
375 #define APR_DECLARE(type)            type

I am confused as to why I am getting this error message – any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:34:19+00:00Added an answer on June 7, 2026 at 1:34 am

    Your compiler flags are likely off, especially for where to search for include files.

    apr comes with the apr-config tool (or possibly apr-1-config), which you’re supposed to run and use for compiler and linker flags

    e.g.

    # apr-config  --cflags  --includes
      -pthread -I/usr/include/apr-0
    

    Tells me I have to pass -pthread -I/usr/include/apr-0 when compiling C code that is using APR .

    There is further information on pkg-config here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using APR library to create portable multi-threading program in C++. Problem is
I just upgraded from tomcat 6.0.29 to 7.0.25 using native apr. Tomcat has crashed
Using Authlogic, the time format for @user.last_login_at looks like this: Mon Apr 12 16:52:56
How do I convert string(09-Apr-2010) in to date time (09 April 2010 00:00:00) using
Possible Duplicate: How to convert yyyy-MM-dd HH:mm:ss to “15th Apr 2010” using PHP I
I need to extract the audio from a FLV file recorded using FMS. I
I am drawing box-percentile plots in R, using the box-percentile panel function from Hmisc
I have a relatively simple program written in C++ and I have been using
I'm creating a small server using java.nio , but when trying to stress test
I get time data '19/Apr/2011:22:12:39' does not match format '%d/%b/%y:%H:%M:%S' when using datetime.strptime('19/Apr/2011:22:12:39','%d/%b/%y:%H:%M:%S') What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.