Advertisement

Current trunk doesn't compile with mingw

Started by January 25, 2014 05:32 PM
4 comments, last by WitchLord 10 years, 9 months ago

Here's extract from compilation log:


../../source/as_thread.cpp: In constructor ‘asCThreadCriticalSection::asCThreadCriticalSection()’:

../../source/as_thread.cpp:332:42: error: ‘InitializeCriticalSectionEx’ was not declared in this scope InitializeCriticalSectionEx(&cs, 4000, 0);

../../source/as_thread.cpp: In constructor ‘asCThreadReadWriteLock::asCThreadReadWriteLock()’:

../../source/as_thread.cpp:382:70: error: ‘CreateSemaphoreExW’ was not declared in this scope readLocks = CreateSemaphoreExW(NULL, maxReaders, maxReaders, 0, 0, 0);

../../source/as_thread.cpp:384:49: error: ‘InitializeCriticalSectionEx’ was not declared in this scope InitializeCriticalSectionEx(&writeLock, 4000, 0);

Thanks. I've fixed this in revision 1820.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

Thanks, confirming as fixed.

Nice work on the new release, people, and the fix for my favorite compiler, gcc :D

However, current trunk run on XP, compiled with VS2010, I get a runtime error:

procedure entry point InitializeCriticalSectionEx could not be located .. in KERNEL32.dll
since that function and CreateSemaphoreExW are Vista+ only.

VS2012 (if I read correctly) works around this if you target pre-Vista (define _WIN32_WINNT=0x0501)...how's that for granular..

Looking at as_thread.cpp, lines 332 and 385:
#ifdef _MSC_VER

if we do like this as some projects do:
#if defined(_MSC_VER) && (!defined(_WIN32_WINNT) || _WIN32_WINNT >= 0x0600)

well it seems I'd still have to add _WIN32_WINNT=0x501 to my definitions to have working code (since it's undefined)...

...or just #if 0 for now ;)

Ah. I'll see what might be the appropriate change to avoid this problem. Thanks for reporting it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this in revision 1829.

I worked around the problem by using InitializeCriticalSectionEx only when compiling the library for a Windows Store App. For any other Windows target it will use the previous non-Ex version.

Regards,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement