PCRE error in MacOS when compiling

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
chemdream
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Sep 24, 2022 9:07 pm

PCRE error in MacOS when compiling

Post by chemdream »

I'm trying to build WxWidgets from source in MacOS on a macbook air M2.

I keep getting this error:

Code: Select all

checking for LIBPCRE... checking whether pcre submodule exists... no
configure: error: 
    Configured to use built-in PCRE library, but the file
    ../3rdparty/pcre/pcre2-config.in couldn't be found.
    You might need to run:

        git submodule update --init 3rdparty/pcre

    to fix this.
When I run that command I get:

Code: Select all

error: pathspec '3rdparty/pcre' did not match any file(s) known to git
Any ideas how to fix this?

Thank you!

Full disclosure: I'm doing this because the brew version of Wx seems to not have a setup.h that I can find in any folder?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: PCRE error in MacOS when compiling

Post by doublemax »

Where did you get the wx sources from?

Code: Select all

git submodule update --init 3rdparty/pcre
This will only work if you also used git to get the wx sources.

If you downloaded a source archive, did you check if the file exist in <wxdir>/3rdparty/pcre ?
Use the source, Luke!
chemdream
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Sep 24, 2022 9:07 pm

Re: PCRE error in MacOS when compiling

Post by chemdream »

The source came from github.

Code: Select all

gh repo clone wxWidgets/wxWidgets 
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: PCRE error in MacOS when compiling

Post by ONEEYEMAN »

Hi,
Please use the official way to get the source code:

git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets.git

after deleting the whole wx folder you have.

Then do:

mkdir buildMac && cd buildMac && ../configure --enable-debug && make

Thank you.
chemdream
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sat Sep 24, 2022 9:07 pm

Re: PCRE error in MacOS when compiling

Post by chemdream »

Thanks for the reply.

I followed your steps. All compiles fine!

However...

I get the error: cannot open source file "wx/wxprec.h"

It's now just a test app in ~/src/test/test.cpp

WxWigdets is in ~/src/WxWidgets

I created a symbolic link to it. So there's ~/src/test/wx
So all of WxWidgets should be searchable in IntelliSense because I have ${workspaceFolder}/**

Just like in my other question in this forum, there's got to be something about VS Code I'm not understanding.
I've been a coder since 1994. But this is my first CPP project. It's making me feel like I know nothing about coding :-)
Post Reply