Using wxWidgets from vcpkg in XCode

16 views
Skip to first unread message

Tim Burgess

unread,
Dec 30, 2025, 4:55:50 AM (3 days ago) 12/30/25
to wx-u...@googlegroups.com

Hi,

 

I’m working on an XCode project that was originally created to use wxWidgets from downloaded source. One of the goals is to use vcpkg for all of our libraries, so I installed the x64-osx and x64-osx-dynamic triplets then attempted to build the project.

 

The build fails, indicating that Xcode can’t find wx.h, even though I issued the ./vcpkg integrate install command. I suppose my questions are:

 

1 – What’s my best strategy for integrating wxWidgets from VCPKG into an Xcode project

 

2 – What do I do about the compiler and linker flags in my build settings?

 

Thanks for any advice.

 

Tim

 

 

 

Maarten Bent

unread,
Dec 30, 2025, 7:49:44 AM (3 days ago) 12/30/25
to wx-u...@googlegroups.com
Hi,

I'm not familiar with vcpkg on macOS with Xcode, but in general CMake will take care of creating the Xcode project and setting the correct compiler and linker flags. It needs the following two lines to find and link with wxWidgets (copied from vcpkg/ports/wxwidgets/usage):

find_package(wxWidgets CONFIG REQUIRED)
target_link_libraries(main PRIVATE wx::core wx::base)

And to make sure vcpkg is correctly initialized, I think you can check if the CMake variable VCPKG_TOOLCHAIN is set.
--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wx-users/014901dc7972%2475adf680%246109e380%24%40raisedbar.net.

Tim Burgess

unread,
Dec 30, 2025, 10:39:12 AM (3 days ago) 12/30/25
to wx-u...@googlegroups.com

Hi Martin,

 

Thanks for the information but we don’t use cmake, I’m afraid.

 

Cheers.

 

Tim

Reply all
Reply to author
Forward
0 new messages