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

  • Home
  • SEARCH
  • 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 6908605
In Process

The Archive Base Latest Questions

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

When I try to build my program the linker fails, telling me that I

  • 0

When I try to build my program the linker fails, telling me that I have undefined references to the PCRE functions.
I have linked libpcre.a and added the directory it is in to the search paths, as well as adding the header files to the search paths, and even rebuilt PCRE a few times by configuring cmake, turning off PCRECPP just in case, and running make on the directory. It seems I can’t do anything to fix it, and I believe that there is a configuration issue. Its probably something silly I did on my part though!

mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
gcc.exe    -c -g -Wall -I/C/Users/One/Documents/Programming/C/Libraries/pcre-8.12 -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.c
main.c: In function 'main':
main.c:278:5: warning: passing argument 3 of 'pcre_compile' from incompatible pointer type [enabled by default]
c:/Users/One/Documents/Programming/C/Libraries/pcre-8.12/pcre.h:282:21: note: expected 'const char **' but argument is of type 'char **'
main.c:282:5: warning: passing argument 3 of 'pcre_compile' from incompatible pointer type [enabled by default]
c:/Users/One/Documents/Programming/C/Libraries/pcre-8.12/pcre.h:282:21: note: expected 'const char **' but argument is of type 'char **'
main.c: In function 'getFileList':
main.c:231:1: warning: control reaches end of non-void function [-Wreturn-type]
main.c: In function 'getFileServer':
main.c:205:1: warning: control reaches end of non-void function [-Wreturn-type]
mkdir -p dist/Debug/MinGW-Windows
gcc.exe     -o dist/Debug/MinGW-Windows/project1 build/Debug/MinGW-Windows/main.o -L/C/Users/One/Documents/Programming/C/Libraries/pcre-8.12/lib -lpcre 
build/Debug/MinGW-Windows/main.o: In function `runRegex':
C:\Users\One\Documents\Programming\C\Projects\project1/main.c:174: undefined reference to `_imp__pcre_exec'
build/Debug/MinGW-Windows/main.o: In function `main':
C:\Users\One\Documents\Programming\C\Projects\project1/main.c:278: undefined reference to `_imp__pcre_compile'
C:\Users\One\Documents\Programming\C\Projects\project1/main.c:282: undefined reference to `_imp__pcre_compile'
collect2: ld returned 1 exit status
  • 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-27T08:35:03+00:00Added an answer on May 27, 2026 at 8:35 am

    For some reason, the compiler was expecting a dynamic library- Once I set the option in CMake, it worked fine. (Though I still couldn’t find out how to make it accept the static library that was built, though I can do so with gcc through the command line)

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

Sidebar

Related Questions

Recently, I have a try to build and run sample hello world program of
i try to build a app that is in landsscape mode all the time.
When I try to build a project in Visual Studio 2005 that has a
I have followed this thread now when i try to build using maven plugin
I am trying to build a program that uses libusb and I get a
I have a large AVL Tree which I build some times during program from
Helllo! I'm trying to build a program that calculates the best score from a
I have a Java program that used a BufferedImage attached to a jPanel to
I have a project that I am working on that references a Common Library
I try to build a gui (Swing) for a simple java application. The application

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.