ZBrushCentral

Shared Library that works only on the platform with Win SDK installed

Hi everyone,

So I have an issue with the custom dll, the dll compiled and works pretty well on my computer as i have the windows sdk installed on it.
But once i share the Zbrush plugin with that Dll, it doesn’t works if the windows 10 sdk isn’t installed, the message error, is the specified exected-file could not be found.
I am using the VS 2019 compilers (amd64) to build the project, I am using Cmake to manage the build.

First observation :
The main difference in the vcxproj files, with the old DLL template which was posted by you Marcus, has a linker flag seet to SubSystem:Windows but mine is set by default to Subsystem:Console because of Cmake.
I haven’t found out how to set it to windows instead of console for a executable it’s simple to do it but i did not found yet how to do this for a shared library.

Second observation :

I include the stdafx.h header in the main.cpp, and he stdafx.h include a targetversion.h header here is the content of the header in case something looks not correct :

#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>

I am not sure how relevant it is or not, but I think something wrong is going here.

Third observation :
I wonder if the included headers from the main.cpp file could also
Here is the included headers from main.cpp :

#include "stdafx.h"

#include "stdio.h"
#include "string.h"
#include "errno.h"
#include "limits.h"
#include "stdlib.h"
#include "math.h"
#include "time.h"
#include "regex"
#include "assert.h"
#include <shellapi.h>

#include "main.h"
#include "switch.h"
#include "pch.h"

I can pack the project if necessary it’s a small one that complete some missing functions in ZUtilFile library.

Best Regards,
Nicolas

damn don’t laugh at me please!
I forget that i compiled the dll in Debug :rofl:

1 Like