Followers 0

## 10 posts in this topic

Hello,

This is my first post here, though I have been lurking on this site for a while.  I have been using Microsoft Visual Studio 2012 Express edition for the past two weeks, so I'm still very new with it.  I tried to compile AngelScript from source using the provided project for VC++ 2012 edition, and I got these 5 errors (used to be 10, with 5 of them being Intellisense errors, those are gone now though):

              Description                                                          File             Line   Col  Project



The error is coming from the file "as_thread.cpp", but from my Google searches and my quick search of the GameDev forum, I haven't found any solutions to remove those errors in order to successfully compile AngelScript.  I was hoping someone on these forums might have an potential solutions or workarounds.  I have tried adding

#include <synchapi.h>


to the code in the file "as_criticalsection.h", since it is running on Windows 8, and InitializeCriticalSection is supposed to be in that header file according to MSDN, but the errors persist.

0

##### Share on other sites

This is strange. I use MSVC2012 Express edition with Windows 8 myself and I do not have these problems.

I'll see if I can figure out what might be going on.

0

##### Share on other sites

Maybe the cpp's are not included in the project itself? (in my experience, Visual Studio does not search among folders to look for files. you have to tell it that there are "existing items". Try to drag and drop those files from the explorer maybe? I dunno. never happened to me before.

0

##### Share on other sites

This is strange. I use MSVC2012 Express edition with Windows 8 myself and I do not have these problems.

I'll see if I can figure out what might be going on.

Well, when I use the pre-processor definition AS_NO_THREADS, I don't get these errors anymore, but to my understanding, that removes the multi-threading capabilities of AngelScript.

Maybe
the cpp's are not included in the project itself? (in my experience,
Visual Studio does not search among folders to look for files. you have
to tell it that there are "existing items". Try to drag and drop those
files from the explorer maybe? I dunno. never happened to me before.

That shouldn't be the problem though, as the methods that are 'not found' are in the headers provided in the Win32 API (according to the MSDN documentation at least).

Edited by PsyKing
0

##### Share on other sites

Yes, defining AS_NO_THREADS disables support for multi-threading and it won't reference the symbols above.

Is it a new installation of MSVC 2012? Have you already compiled other windows applications, or is AngelScript the first project you attempt to compile? Perhaps the Windows SDK hasn't been properly installed, and that is why it doesn't see the symbols.

Another thought is that perhaps you're having the project settings to generate the code for non-multithreaded CRT library. I'm not in front of my home computer at the moment to test this, but I imagine that this may make the compiler not see these symbols in the Windows SDK.

0

##### Share on other sites

Are you attempting to build a Metro UI application for Windows Store? Or an ordinary Windows desktop application?

I found a link on google that hinted at these functions not being available for the Metro UI. And in fact, by reading the MSDN document carefully it is stated that these versions of the functions are only available for desktop applications. For Windows Store applications the extended versions of the functions must be used instead, i.e. InitializeCriticalSectionEX, CreateSemaphoreEx, and WaitForSingleObjectEx.

Can you try changing the functions to the extended versions and see if that fixes your problem?

0

##### Share on other sites

Yes, defining AS_NO_THREADS disables support for multi-threading and it won't reference the symbols above.

Is it a new installation of MSVC 2012? Have you already compiled other windows applications, or is AngelScript the first project you attempt to compile? Perhaps the Windows SDK hasn't been properly installed, and that is why it doesn't see the symbols.

Another thought is that perhaps you're having the project settings to generate the code for non-multithreaded CRT library. I'm not in front of my home computer at the moment to test this, but I imagine that this may make the compiler not see these symbols in the Windows SDK.

I have successfully compile the PocoProject libraries with it, but it is a new and fully updated copy of MSVC2012.  I was using the default settings that came with the AngelScript project that was specifically there for MSVC2012, so it should've already been set-up for using the multithreaded CRT library (but I will check).

Edit: I checked and it is using the multithreaded CRT.

Are you attempting to build a Metro UI application for Windows Store? Or an ordinary Windows desktop application?

I found a link on google that hinted at these functions not being available for the Metro UI. And in fact, by reading the MSDN document carefully it is stated that these versions of the functions are only available for desktop applications. For Windows Store applications the extended versions of the functions must be used instead, i.e. InitializeCriticalSectionEX, CreateSemaphoreEx, and WaitForSingleObjectEx.

Can you try changing the functions to the extended versions and see if that fixes your problem?

I won't touch the Metro UI unless I absolutely have to.  I'm creating a desktop application, so I have access to what the W8 apps don't have access to.

Edited by PsyKing
0

##### Share on other sites

Still, give it a try. Just change the name of the functions to add the suffix Ex. If this is the problem, then the error 'identifier not found' will go away. Of course, the compilation will fail because of incorrect function arguments, but that should be easy to fix with the use of some default arguments.

I'll probably end up changing to the Ex versions anyway as I want the library to compile properly for Metro too (even if you're not trying to build for Metro), but it would be good to have a confirmation that this is really the problem you're facing.

0

##### Share on other sites

Still, give it a try. Just change the name of the functions to add the suffix Ex. If this is the problem, then the error 'identifier not found' will go away. Of course, the compilation will fail because of incorrect function arguments, but that should be easy to fix with the use of some default arguments.

I'll probably end up changing to the Ex versions anyway as I want the library to compile properly for Metro too (even if you're not trying to build for Metro), but it would be good to have a confirmation that this is really the problem you're facing.

It seems that I didn't need to...  I'm so confused now, I compiled it again (without changing anything), and it compiled successfully.  It compiled correctly in both the default AngelScript project and the one that I've imported it into (I've moved files around in the import to my project).  I still tried changing the methods to the extended ones, and it seems that they are now not being recognised where the non-extended ones are being recognised now.  This is really strange.

0

##### Share on other sites

Strange, indeed.

Still, it's clear that it is something to do with the project settings and/or MSVC2012 rather than the code. I hope you manage to figure it out.

I will however make the necessary code changes to allow AngelScript to be used in Windows Store applications too, so I thank you for bringing this to my attention.

0

##### Share on other sites

Strange, indeed.

Still, it's clear that it is something to do with the project settings and/or MSVC2012 rather than the code. I hope you manage to figure it out.

I will however make the necessary code changes to allow AngelScript to be used in Windows Store applications too, so I thank you for bringing this to my attention.

I would imagine it's MSVC2012 (probably just mine, as you weren't experiencing the problems).  No need to thank me, I should be the one thanking you for writing such an amazing piece of software and letting everyone use it free of charge.

0

## Create an account

Register a new account