Vs2015 Build failure - unicode problems

Post Reply
DannyChapman
Posts: 85
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Vs2015 Build failure - unicode problems

Post by DannyChapman » Wed Oct 18, 2017 9:22 pm

I've download bullet3-2.87.zip ready to use it in a new project, run build_visual_studio_without_pybullet_vr.bat, open the build3/vs2010/0_Bullet3Solution.sln in Visual Studio 2015 (Update 3).

If I just compile, I hit things like this:

10>..\..\examples\SharedMemory\b3PluginManager.cpp(117): error C2664: 'HMODULE LoadLibraryW(LPCWSTR)': cannot convert argument 1 from 'const char *' to 'LPCWSTR'

This is:

Code: Select all

		B3_DYNLIB_HANDLE pluginHandle = B3_DYNLIB_OPEN(pluginPath);
with

Code: Select all

    #define B3_DYNLIB_OPEN    LoadLibrary
and that comes from

Code: Select all

#ifdef UNICODE
#define LoadLibrary  LoadLibraryW
#else
#define LoadLibrary  LoadLibraryA
#endif // !UNICODE
where UNICODE is defined implicitly.

If I change B3_DYNLIB_OPEN to explicitly use LoadLibraryA, I then hit:

Code: Select all

#warning "Unknown platform for PLATSUBDIR"
in pathtools.h - as WIN32 is not defined.

I can get around this by just deleting the App_PhysicsServer_SharedMemory_VR project from the solution.

With these hacks the demo/test app runs so it's all fine (not interested in the missing project) - I'm just surprised I can't see anybody else mentioning this! Is there something weird about my setup? Apart from it being Windows of course :)

DannyChapman
Posts: 85
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: Vs2015 Build failure - unicode problems

Post by DannyChapman » Thu Oct 19, 2017 11:43 pm

In addition - the make system makes the projects have the debug and release libs have the same name! Consequently you'll get all sorts of linker errors.

So far my success at building and linking against Bullet comes from:

1. Changing the build_*.bat scripts to use vs2015 rather than vs2010 (because premake5 supports it)
2. Deleting all the projects apart from the core Bullet (+LinearMath) ones in the solution
3. Adding Debug to the target name for all the projects when building in Debug
4. Using #define BT_NO_PROFILE 1 in btQuickprof.h as that caused me trouble s a while back
5. Linking against BulletDynamics.lib, BulletCollision.lib and LinearMath.lib

It seems odd I need to do these things...

Post Reply