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 635933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:27:35+00:00 2026-05-13T20:27:35+00:00

I have a dependancy library (libfcgi) that I compiled with g++ (GCC v4.4 MinGW)

  • 0

I have a dependancy library (libfcgi) that I compiled with g++ (GCC v4.4 MinGW) using the following calls:

g++ -Iinclude -c -O2 *.c
ar rcs ../libfcgi.a *.o

Now, my main project is built like so:

g++ -Idependancies\libfcgi\include -Ldependancies -O2 -lfcgi *.cpp

g++ apparently finds libfcgi.a, but yet it fails to link to the following references:

‘FCGI_printf’
‘FCGI_Accept’

In the libfcgi sources, these functions are defined as follows:

#ifdef __cplusplus
extern "C" {
#endif
//...
DLLAPI int FCGI_printf(const char *format, ...);  
DLLAPI int FCGI_Accept(void);
//...
#ifdef __cplusplus
}
#endif

where DLLAPI is nothing (as it isn’t compiled as a shared library) and __cplusplus is defined (g++).

Looking at libfcgi.a, those functions are exported as ‘_FCGI_Accept’ and ‘_FCGI_printf’, so with an underscore in front. That’s what seems to hinder g++ to find them.

I thought using export “C” would suffice to link to a C function in C++, so what am I doing wrong?

Thanks 🙂

  • 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-05-13T20:27:36+00:00Added an answer on May 13, 2026 at 8:27 pm

    If you have the same extern “C” definitions in your .cpp sources, then I think your problem is that the -lfcgi should follow the *.cpp in your command line:

    g++ -Idependancies\libfcgi\include -Ldependancies -O2 *.cpp -lfcgi
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an application that has a dependancy on gdiplus. i need the application
I have the following dependency property that works fine but it does not auto
I have a class library that I have written in C#.net. I want to
I have a python library that has a dependency on importlib . importlib is
I have created a cross compiled arm executable. I want to find the library
I have written a method (shown below). The project is compiled using ARC, but
I have been working on a C++ project that links to a .so(dynamic library)
I have a library I made, and now I want to utilize it in
I have a library of functions that is packaged up as a gem. One
I have 100 modules in my library. I have 5 different websites. now any

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.