Advertisement Jump to content
Sign in to follow this  
_Vicious_

Current trunk doesn't compile with mingw

This topic is 1803 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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);

Share this post


Link to post
Share on other sites
Advertisement
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 ;)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!