I keep getting a build error with "wxmsw31u_html.lib" and "wxmsw31ud_html.lib" in "wx_richtext.vcxproj" for WxWidgets 3.1.7 on Visual Studio 2022 v17.2. The full log is attached.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
There are no errors in this log. I don't know what's going on, but we can't do anything without at least some information.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I'm confused. I attached a build log with the errors. Do you mean that you weren't able to reproduce the error yourself?
This is the result at the end: Build:
188 succeeded, 4 failed, 0 up-to-date, 0 skipped
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
There are no errors in the file. I have no idea what does "4 failed" mean, but there are no errors anywhere before.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I cannot reproduce it, but it does have the lines LINK : fatal error LNK1181: cannot open input file 'wxmsw31u_html.lib'.
When I right-click the richtext project in wx_vc17.sln and check project dependencies, it does not depend on html, so this could be a bug...
Maybe it only shows up when you build with 1 cpu core?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Looking at the log, it looks like the projects aren't built in the proper order. wx_richtext.vcxproj attempts to link (line2816) and fails. html is built just below that.
Hang on. richtext is tring to link to 'wxmsw31u_html.lib' but you build 'wxmsw317u_html_vc_x64_custom.dll'.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Good catch. The solution file only lists core and xml as project dependencies for richtext but the in wx_richtext.vcxproj lists quite a lot of wx DLLs:
wxtiff$(wxSuffixDebug).lib;wxjpeg$(wxSuffixDebug).lib;wxpng$(wxSuffixDebug).lib;wxzlib$(wxSuffixDebug).lib;wxregex$(wxSuffix).lib;wxexpat$(wxSuffixDebug).lib;$(wxToolkitLibNamePrefix)html.lib;$(wxToolkitLibNamePrefix)core.lib;$(wxBaseLibNamePrefix).lib;$(wxBaseLibNamePrefix)_xml.lib;%(AdditionalDependencies)
So it's a race condition in which sometimes we get lucky and the dependencies are done building early enough.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Sorry, I have no idea what happened, I must have made a typo in "error" when grepping for it :-(
I do see the errors now. I still don't know why would we have any dependency problems when building static libraries and I definitely can't reproduce it here (I build with MSVS many times a day), but something must still be wrong in our solution file.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Are the solution files hand-crafted or created by a generator? Perhaps your generator is populating the AdditionalDependencies in each project but only inserting some of them in the solution file.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Solution files are currently maintained manually.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I was so confused by the initial replies. Thanks for the updates.
I cannot reproduce it, but it does have the lines
LINK : fatal error LNK1181: cannot open input file 'wxmsw31u_html.lib'. When I right-click therichtextproject inwx_vc17.slnand check project dependencies, it does not depend onhtml, so this could be a bug... Maybe it only shows up when you build with 1 cpu core?
My computer has four cores and I believe Visual Studio 2022 defaults to using all available cores for builds.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I went looking for a .sln generator and found this. I think you can add the dependent DLL names in a .vcxproj file and run this to create a .sln with the right dependencies. Give it a look and see.
https://microsoft.github.io/slngen/
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Ignore the slngen thing. I found an easier path. Get rid of the dependencies in the .sln and replace them with a ProjectReference in the .vcxproj file. You can do this with the GUI by right-clicking on References for each project and adding the dependencies. Or you just add the XML at the end of each .vcxproj file. You'll need to look up the dependent project's GUID in its .vcxproj to add. Here's an example to add to wx_richtext.vcxproj to add the wx_html project:
<ItemGroup>
<ProjectReference Include="wx_html.vcxproj">
<Project>{33cc42f9-7756-5587-863c-8d4461b7c5dd}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
Add more ProjectReference stanzas inside the ItemGroup for additional dependencies.
More info here: https://docs.microsoft.com/en-us/dotnet/core/tools/dependencies
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
As the .vcxproj files are shared for all msbuild-based solutions, this issue applies to all solutions from MSVS 2010 up. I created wx_vc17.sln just by importing wx_vc16.sln into MSVS 2022.
The issue is clearly there but it is odd that no one noticed this before.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I went ahead and looked up the GUIDs for all the dependencies in richtext and created this to stick at the bottom.
<ItemGroup>
<ProjectReference Include="wx_wxtiff.vcxproj"><Project>{75596CE6-5AE7-55C9-B890-C07B0A657A83}</Project></ProjectReference>
<ProjectReference Include="wx_wxjpeg.vcxproj"><Project>{6053CC38-CDEE-584C-8BC8-4B000D800FC7}</Project></ProjectReference>
<ProjectReference Include="wx_wxpng.vcxproj"><Project>{8ACC122A-CA6A-5AA6-9C97-9CDD2E533DB0}</Project></ProjectReference>
<ProjectReference Include="wx_wxzlib.vcxproj"><Project>{8B867186-A0B5-5479-B824-E176EDD27C40}</Project></ProjectReference>
<ProjectReference Include="wx_wxregex.vcxproj"><Project>{56A4B526-BB81-5D01-AAA9-16D23BBB169D}</Project></ProjectReference>
<ProjectReference Include="wx_wxexpat.vcxproj"><Project>{A1A8355B-0988-528E-9CC2-B971D6266669}</Project></ProjectReference>
<ProjectReference Include="wx_html.vcxproj"><Project>{33cc42f9-7756-5587-863c-8d4461b7c5dd}</Project></ProjectReference>
<ProjectReference Include="wx_core.vcxproj"><Project>{6744DAD8-9C70-574A-BFF2-9F8DDDB24A75}</Project></ProjectReference>
<ProjectReference Include="wx_base.vcxproj"><Project>{3FCC50C2-81E9-5DB2-B8D8-2129427568B1}</Project></ProjectReference>
<ProjectReference Include="wx_xml.vcxproj"><Project>{3E6DCA27-5FA3-53EC-BBD6-2D42294B7AE6}</Project></ProjectReference>
</ItemGroup>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I don't think you have to add all of them. Projects like zlib, png, etc, are already dependencies of base and core, and then core is a dependency of richtext.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@MaartenBent I just grabbed everything in AdditionalDependencies, so perhaps that also could be shortened? The lower-level dependencies can be moved to the base and core project files.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I moved the lower level dependencies to base and core and the build order still looks right. base also needs a dependency on the wx_custom_build project ({01F4CE10-2CFB-41A8-B41F-E54337868A1D}), to replace the one in the .sln file.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I'm not sure how does ProjectReference interact with the dependencies in the solution file, but I think we should use either one or the other but not mix both of them. Are there sufficient advantages to the former to justify converting to it? If not, IMO we should just add the missing dependency to the .sln files.
In any case, any PRs fixing this would be welcome, TIA!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
The dependencies in the solution file are redundant and a consequence of history. MS continues to migrate away from the ancient solution file format and VS (via MSBuild) internally converts them to temporary XML project files before commencing a build. Some interesting pages about this:
https://stackoverflow.com/questions/65732543/what%C2%B4s-the-purpose-of-projectdependencies-in-vs-solution-file
https://stackoverflow.com/questions/5629981/whats-the-purpose-of-this-string-in-my-visual-studio-sln-file
https://web.archive.org/web/20110406075102/http://connect.microsoft.com/VisualStudio/feedback/details/586875/msbuild-4-0-incorrectly-processes-project-dependencies-specified-in-solution-file
You can force MSBuild to save the temporary project file with an environment variable:
https://stackoverflow.com/questions/5237884/generating-an-msbuild-project-file-from-a-visual-studio-solution-file-and-projec/5237948#5237948
I think migrating the dependencies to the individual project files keeps them together with the object they affect and are easier to maintain. If you add/remove a dependency for a project, you don't need to touch two files.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I agree that putting dependencies in the project files makes more sense, but this doesn't seem critical, so for now I'll just add the missing dependency of richtext on html manually and close this.
Any future PRs would be welcome but after 3.2.0.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #22510 as completed via ddcb047.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()