Skip to content

Unable to build project #4

@peter-r-g

Description

@peter-r-g

I have been trying to get this project built but I cannot seem to get it working. I have been jumping down a rabbit hole of issues that I will detail below in the order I encountered them. Fair warning, I am quite new when it comes to C++ and its environment.

Release mode "Debug Information Format" option

Currently, the mentioned option is set to "Program Database for Edit And Continue (/ZI)" which prevents a build from happening because of the following error: /ZI' and '/GL' command-line options are incompatible. My solution was just to disable the option.

VCPKG package locations

Right now the Native > Host project expects the VCPKG packages to be installed at $(VcpkgRoot)\installed\$(Platform)-windows. Multiple issues with this when it comes to the latest version of VCPKG. The "VcpkgRoot" environment variable does not exist; The only one that seems to be used is "VCPKG_ROOT". Additionally, the directory "installed" under that root is never created. VCPKG instead creates a "vcpkg_installed" directory in the current working directory that you run the command; Which in this case is the same directory that the setup.cmd file is in. The solution to this would be to move the setup.cmd and vcpkg.json files into the solution directory and edit the external include directory to this: $(SolutionDir)vcpkg_installed\$(Platform)-windows\include\SDL2.

VCPKG setup broken for x64

For a reason that I cannot figure out when using the provided setup file. It will add all of the x86 packages but for x64 it will throw a shared directory in there and none of the packages. Because of this, on x64 you will not get any of the packages and fail to build. The current solution I have come up with is to make two separate setups for both x86 and x64 like so: vcpkg install --triplet=(x64/x86)-windows

VCPKG Packages not included

The current setup of Native > Host does not actually include any of the packages except for a portion of SDL2. Fixing this is just adding an extra entry without the "SDL2" directory: $(SolutionDir)vcpkg_installed\$(Platform)-windows\include.

VCPKG Missing packages

The vcpkg.json for Native > Host appears to be missing a couple of entries. From what I can tell it is missing the following packages: nethost, nlohmann-json, sdl2-image.

VulkanSDK

Currently, the Native > Host uses a hard-coded include path to VulkanSDK 1.3.224.1. Instead, it should use the VULKAN_SDK environment variable like so: $(VULKAN_SDK)\Include.

FMT Versioning

With VCPKG it installs the latest available version of a package. The current version of FMT is 9.1.0. Using said version creates the following error: fmt::v9::detail::arg_mapper<context>::map': was declared deprecated (compiling source file logmanager.cpp). The solution to this is to enforce the FMT package being used is of version 8.1.1; Before the breaking change was introduced. Achieving this is done by editing the vcpkg.json like so:
Adding property builtin-baseline with the value being the latest commit hash your VCPKG was built with (I think?). For example: "builtin-baseline": "0d239eb4d32f125c3da90e612096b14a11ef1474"
Adding another property overrides as an array with a single object inside detailing the FMT version:

{
    "name": "fmt",
    "version": "8.1.1"
}

The end result should be something like the following:

{
    "name": "mocha",
    "version-string": "1.0.0",
    "description": "Mocha game engine",
    "builtin-baseline": "0d239eb4d32f125c3da90e612096b14a11ef1474",
    "dependencies": [
        "fmt",
        "glm",
        "glslang",
        "nethost",
        "nlohmann-json",
        "sdl2",
        "sdl2-image",
        "spdlog",
        "vulkan-memory-allocator"
    ],
    "overrides": [
        {
            "name": "fmt",
            "version": "8.1.1"
        }
    ]
}

Linker errors

This is the part where my lack of C++ knowledge kills my progress. I am unsure of where to go from this point but getting this far will show 76 "unresolved external symbol" errors. From what I can tell all of them come from the usage of items in packages. The list of errors is available on Pastebin here.

Conclusion

All the issues mentioned I have been resolving in my own fork of the project here and will make a PR when it is finished.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions