thpatch / thtk

Touhou Toolkit
https://thtk.thpatch.net/
Other
313 stars 42 forks source link

Running thdat: "thtk.dll not found" (Windows 10, no pkg-config) #95

Closed Gri-49 closed 2 years ago

Gri-49 commented 2 years ago

Hi, I am trying to run the thdat command, and I am always getting a "missing dll" error message.

I am on Windows 10. I am a programmer, but this is the first time I had to play around a C project, so I may have missing something "obvious".

Here's how I builded the TouhouToolkit:

  1. Installed win_flex_bison and set the exe into the env variables
  2. Clone this repo master branch locally
  3. Use "git submodule update --recursive" to fetch the zlib, libpng and thtypes submodules
  4. Use cmake-gui to generate the project
    • Use Visual Studio 2022 (Community Edition) as Generator with x64 platform
    • Configure (pass with warning)
      • I am only getting a "Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)" warning.
    • Change the value for CMAKE_INSTALL_PREFIX to "TouhouToolkit" (without a space)
    • Generate (pass)
    • Open project (it will start Visual Studio 2022)
  5. Build the "ALL_BUILD" project (build pass without issues)
  6. Build the "INSTALL" project (build pass without issues)
  7. Add the "TouhouToolkit/bin" folder into the env variables
  8. Run "thdat" (expecting some help message to appear)
    • This cause this error message to appear:

errorTouhou

The same result happens with Touhou Toolkit GUI (as expected).

Am I missing anything, or is the project still unstable on Windows?

I started the build a few days ago, and couldn't build the project because the master branch was broken (I couldn't generate the project correctly). Once I pulled the latest commit, I was able to build the Toolkit using VS 2022, but it seems something is still missing.

Could anyone confirm the followings:

Thanks.

Geotsx commented 2 years ago

Do you have this dll in your build directory? If you don't, then just try building it for win32 Also install msys2 for pkg-config it's very important

Gri-49 commented 2 years ago

Yes. In the TouhouToolkit folder, I have the bin folder (with thdat in it), and next to it there's a "lib" folder with "thtk.dll" and "thtk.lib".

I'll try to configure pkg-config and see if it fixes the problem.

Gri-49 commented 2 years ago

Ok. This was very dumb of me.

I didn't see that the "Releases" had already builded version of the toolkit. I though they were only release notes at first.

Well, thanks for the help and sorry about that.

DankRank commented 2 years ago

Do note that the releases are quite outdated (2019). We've recently set up automated builds, you can get them here: https://nightly.link/thpatch/thtk/workflows/build/master (x86 version is recommended).

Regarding the build problems: