Step 1.
I build wxWidgets with wxUSE_UNICODE=OFF and wxBUILD_SHARED=OFF, then link it to an executable of a different project, everything goes well.
Step 2.
I compile wxWidgets with Unicode support and change the flag wxUSE_UNICODE=ON. The build of wxWidgets goes well but then when linking it to the same different project, I get this error:
c:\Home\Workspaces\cranberry\scripts\..\third_party\build\win\install\wxWidgets\Release\include\msvc\wx/setup.h(142,10): fatal error C1083: Cannot open include file: '../../../lib/vc_x64_lib/msw/wx/setup.h': No such file or directory
The directory lib/vc_x64_lib/msw/wx indeed does not get generated but lib/vc_x64_lib/mswu/wx
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #23725 as not planned.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Sorry but this is obviously a rebuild issue in your project and not a wx problem, i.e. something got cached from the previous build and not cleaned up because the project is still looking for the non-Unicode path. Please clean everything and it should work.
As an aside, building wx without Unicode support is deprecated and won't be supported at all in the future versions, please don't do it, there is absolutely no reason for it any more.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Step 2 is a clean build. The generated directory is lib/vc_x64_lib/mswu while setup.h refers to lib/vc_x64_lib/msw
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
If setup.h uses msw, this means it's not from a build with Unicode enabled, which is clearly not going to work now that you do build your application with Unicode.
I'm sorry but I'm 100% sure that if you remove your existing wx installation and repeat the same steps without setting wxUSE_UNICODE to 0, everything will work just fine.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Hello
Here is the precise CMakeLists.txt file I have for building wxWidgets:
cmake_minimum_required(VERSION 3.14)
project("third-party")
include(ExternalProject)
ExternalProject_Add(wxWidgets
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install/wxWidgets
GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets.git
GIT_TAG v3.2.0
GIT_SHALLOW True
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=<INSTALL_DIR>/$<CONFIG>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS=OFF
-DENABLE_PUBLIC_SYMBOLS=OFF
-DwxBUILD_SHARED=OFF
)
It generates mswu directory. When I compile my application that includes header files the just built wxWidgets, it tries to include setup.h which refers to msw directory. What am I doing wrong?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
What am I doing wrong?
Sorry, I don't know, I'm not a CMake expert by any means and, in any case, I guess it depends on how you compile your application. What I do know is that if you follow the instructions for building wxWidgets and building your application using CMake from the manual, they work.
And unfortunately, but not surprisingly, we don't have the resources to debug problems in your build system, all I can say is that the problem seems to be related to mismatching wxUSE_UNICODE settings in the library and your application which might hopefully help you to find the problem there. Good luck!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
The description of the build procedure in the official documentation is not comprehensive.
Q1. I build wxWidgets with Unicode enabled. The directory lib/vc_x64_lib/mswu gets generated - is this expected?
Q2. Visual Studio is used for compilation. When compiling an application with so build wxWidgets, I set the location of wxWidgets' header files
./install/wxWidgets/Release/include
./install/wxWidgets/Release/include/msvc
Then ./wxWidgets/Release/include/msvc/wx/setup.h refers to non-existing path lib/vc_x64_lib/msw/setup.h. Why does it refer the non-existing path?
Thank you
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
The description of the build procedure in the official documentation is not comprehensive.
Q1. I build wxWidgets with Unicode enabled. The directory
lib/vc_x64_lib/mswugets generated - is this expected?
Yes, it is.
Q2. Visual Studio is used for compilation. When compiling an application with so build wxWidgets, I set the location of wxWidgets' header files ./install/wxWidgets/Release/include ./install/wxWidgets/Release/include/msvc Then ./wxWidgets/Release/include/msvc/wx/setup.h refers to non-existing path
lib/vc_x64_lib/msw/setup.h. Why does it refer the non-existing path?
You said:
"I set location"
You locations are wrong.
/install/wxWidgets/Release/include/msvc - why? Do you use any Windows-specific classes?
`lib/vc_x64_lib/msw/setup.h - first the directory needs to e fixed by adding "u".. And second - it needs to be added to the Include Folders Settings of your project.
Thank you
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Q1. I build wxWidgets with Unicode enabled. The directory
lib/vc_x64_lib/mswugets generated - is this expected?
Yes.
Q2. Visual Studio is used for compilation. When compiling an application with so build wxWidgets, I set the location of wxWidgets' header files ./install/wxWidgets/Release/include ./install/wxWidgets/Release/include/msvc
If you're using CMake, you're supposed to use it for your application too. I don't understand the point of building wx with CMake and then not using it for your app, this seems like intentionally trying to make your life more difficult.
Then ./wxWidgets/Release/include/msvc/wx/setup.h refers to non-existing path
lib/vc_x64_lib/msw/setup.h. Why does it refer the non-existing path?
Because you must have changed the default project settings and UNICODE is not predefined as it should be.
Frankly,I have no idea what are your doing, so let me say again: please follow the documentation for building with MSVS if you just want things to work. Otherwise you're free to do whatever you want but you can't expect us to find problems in your custom ad hoc build system.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
/install/wxWidgets/Release/include/msvc - why? - because otherwise it looks for wx/setup.h from platform.h and cannot find it.
lib/vc_x64_lib/msw/setup.h - first the directory needs to e fixed by adding "u" - this reference is automatically generated during the build of wxWidgets. I would be glad to fix it - how? Actually, this is the very point of the issue I created.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I'm sorry but this is hopeless. One last time: please read the instructions for using wx with MSVS. You're not following them at all for whatever reason and then are somehow surprised that things don't work.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Yes, you are right: you are hopeless.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@idruker-cerence ,
As Vadim said in his previous reply - you are mixing 2 completely different build system and somehow expect them to work.
Please use either MSVC or CMake but not both.
wxWidgets do provide an out of the box solution for MSVC to build the library itself.
Or if you want to use CMake - use it to build you application s well.
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@idruker-cerence , As Vadim said in his previous reply - you are mixing 2 completely different build system and somehow expect them to work. Please use either MSVC or CMake but not both. wxWidgets do provide an out of the box solution for MSVC to build the library itself. Or if you want to use CMake - use it to build you application s well.
Thank you.
Hello. With all respect, Vadim's way to respond to reported issues is not a proper one. I outlined the problem from a high perspective so that a professional would ask for details in order to grasp the entire picture and give a valuable advice. Instead, he played a role of a cool, arrogant guy who is too busy to waste his time for stupid questions.
So to make it clear: both wxWidgets and the application are build with cmake that uses Visual Studio as a generator. He would know that if he asked a clarification question.
Never mind, guys, I will figure that out. Promise to not bother you again.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Maybe your project is not defining _UNICODE?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Maybe your project is not defining
_UNICODE?
The issue has been fixed. Thank you all.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()