Scons can't find my compiler

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Scons can't find my compiler

Postby SoulRider » 2014-04-10, 20:57

I have avoided posting as I am trying to solve this myself, but after two days, I concede I need help.

I am on win 8.1, using C++ Express 2013 Desktop. Python 2.7.6 (32bit), and Scons 2.3.1.

When running scons with default CompilerSetup.py I get the following error:

Code: Select all

scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "G:\Scripts&Programs\CaFu\cafu-cafu-24e80ec83ed9\SConstruct", line 5, in <module>

scons: warning: No version of Visual Studio compiler found - C/C++ compilers most likely not set correctly
File "G:\Scripts&Programs\CaFu\cafu-cafu-24e80ec83ed9\CompilerSetup.py", line 45, in <module>
KeyError: 'MSVC_VERSION':
  File "G:\Scripts&Programs\CaFu\cafu-cafu-24e80ec83ed9\SConstruct", line 57:
    if envCommon["MSVC_VERSION"] in ["8.0", "8.0Exp"]:
  File "C:\Program Files (x86)\Python27\Scripts\..\Lib\site-packages\scons-2.3.1
\SCons\Environment.py", line 413:
    return self._dict[key]


This is with the environment left unchanged. If I specify

Code: Select all

MSVC_VERSION="12.0Exp"


It tells me version it is not installed. I repaired my VS installs, but I am still getting the same issue.

Windows tells me visual studio is installed fine. Any ideas?
User avatar
Carsten
Site Admin
Posts: 2132
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Scons can't find my compiler

Postby Carsten » 2014-04-10, 22:56

Hi SoulRider,

unfortunately, SCons 2.3.1 does not support VC++ 2013 (12.0 or 12.0Exp) yet. As a result, I am very sorry to say that we cannot use VC++ 2013 with Cafu at this time.

This is really unfortunate and I don't like it either. In fact, after I read your message, I was about upgrading my older SCons, downloading and installing VC++ Express Edition 2013 next to my 2012, planning to make the necessary updates to the SConstruct file, test and commit, so that you can proceed -- and only then saw that even with SCons 2.3.1, VC++ 2013 is not supported yet.

Since the SCons 2.3.1 release in early March, the SCons developers have upgraded their code base to support VC++ 2013, it's readily available in the SCons repository and could be used to patch a local copy of SCons 2.3.1, however I'm currently not dug into this deeply enough to recommend it to you with good conscience. I also don't know when they will make the next official release, e.g. 2.3.2 or 2.4, that would includes the latest changes.

As an alternative, would it be an option for you to install the older VC++ 2012 Express Edition?

That's what I use under Windows 8.1, and it works very well. (Please note the subsection "64-bit Windows with Visual C++ 2010 or 2012 Express Editions" at the bottom of section Compiler Setup in the manual.)

I'm sorry that I have no better news at this time, but right now, the only options are installing VC++ 2012 (my recommendation), patch the SCons source code, or wait for a new SCons release... :oops:
Best regards,
Carsten
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-11, 00:12

Thanks for the help.

I will go the 2012 route for now. I don't want to add too many more headaches to the job already :)
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-11, 00:48

Ok, Got the build successfully running with VS2012, but get this error with VarVisitorsLua.cpp which causes the build to terminate because of errors.

Code: Select all

cl /FoLibs\build\win32\vc11\x86_amd64\release\VarVisitorsLua.obj /c Libs\VarVisi
torsLua.cpp /TP /nologo /GR /EHsc /MD /O2 /Ob2 /J /W3 /WX /D_CRT_SECURE_NO_DEPRE
CATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG /DSCONS_BUILD_DIR=build/win32/vc11/x86
_amd64/release /IExtLibs\freetype\include /IExtLibs\libpng /IExtLibs\zlib /ILibs
 /IExtLibs /IExtLibs\bullet\src /IExtLibs\lua\src /IExtLibs\lwo /IExtLibs\jpeg
VarVisitorsLua.cpp
Libs\VarVisitorsLua.cpp(270) : error C2220: warning treated as error - no 'objec
t' file generated
Libs\VarVisitorsLua.cpp(270) : warning C4267: 'initializing' : conversion from '
size_t' to 'const int', possible loss of data
scons: *** [Libs\build\win32\vc11\x86_amd64\release\VarVisitorsLua.obj] Error 2
scons: building terminated because of errors.


I am running the entity component build. I also get an note at the start of the build which doesn't seem to cause a problem advising FBX SDK is not present.
User avatar
Carsten
Site Admin
Posts: 2132
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Scons can't find my compiler

Postby Carsten » 2014-04-11, 09:27

Did you add line

Code: Select all

envCommon = Environment(TARGET_ARCH="x86");
to the CompilerSetup.py file?

(It seems like your version of SCons can properly deal with the 64-bit compiler that comes with VC++ 2012, but then the compile fails in 64-bit build mode. Looks like I should upgrade and retry, after all... ;-) )

The notice about the FBX SDK is ok, it's just a reminder.
Best regards,
Carsten
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-11, 21:19

I didn't add the line. I've left the environment field blank to use defaults. I would love it to build in 64-bit if possible, but whatever it does, is what it does. As per the instructions on the install page, I used the 32-bit version of python, and ran everything, this error is the fault it is stuck on if I try and launch scons again.
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-11, 21:27

I see that is treating this warning as an error.

I there anyway to loosen the tightness of the compile rules? It seems to my limited knowledge, that the compiler is getting in a bit of a mess with the fact you are calling a table, but data may be lost, as you are saving to a const int. I understand you are only taking the length of the table, but the compiler is deciding that warning is enough to upgrade to an error.
User avatar
Carsten
Site Admin
Posts: 2132
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Scons can't find my compiler

Postby Carsten » 2014-04-11, 22:38

Well, the compiler is forced to treat warnings as errors by the /WX flags defined in lines 418 to 420 of the SConstruct file. If you remove this flag in the three lines, the behaviour is relaxed.

However, I don't recommend doing this. For one, this will surely not be the only issue when compiling as 64-bit code, because it's a long time since I last did this under Windows (but always do under Linux). This first warning may be negligible, but the others may not. Also, Cafu is intended to compile without errors or warnings. Leaving /WX activated is good practice, and I normally never ignore a warning, because there is usually a good reason for it (even though a small code change is usually enough through to "fix" the problem).

Generally, I'd recommend to add the above line to the CompilerSetup.py file for now, make sure that that builds without problems first. The 32-bit code will be built in a separate directory "next" to the 64-bit code (optional, to be built later), so that you can later use both in parallel, if you wish to.
Best regards,
Carsten
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-12, 02:23

With the Target x86 line, I get this failure:

Code: Select all

wxbase30u.lib(baselib_intl.obj) : fatal error LNK1112: module machine type 'x64'
 conflicts with target machine type 'X86'
scons: *** [build\win32\vc11\x86\release\Ca3DE\Cafu.exe] Error 1112
scons: building terminated because of errors.


I can build the engine in 64-bit mode if I comment out the warnings, however I get an error stating no renderer can be found for my system. I will have a look at that further, but the 32-bit build just doesn't want to know.
User avatar
Carsten
Site Admin
Posts: 2132
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Scons can't find my compiler

Postby Carsten » 2014-04-12, 09:59

Ok, this looks as if wxWidgets was successfully built as 64-bit code first, but now the otherwise successful 32-bit build tries to link to the 64-bit wxWidgets libraries, which fails. (This is not supposed to happen, but from the information I have here, I cannot quite see why this is so).

Let's focus on getting the 32-bit build ("x86") right first: With the above line in CompilerSetup.py still in, please delete these directories

Code: Select all

ExtLibs\wxWidgets\build\msw\vc11_mswu
ExtLibs\wxWidgets\build\msw\vc11_mswud
ExtLibs\wxWidgets\lib\vc11_lib

then re-run SCons. It will re-build wxWidgets in 32-bit mode, and should then be able to successfully complete the build.

Although building 32- and 64-bit versions next to each other should work as outlined above, it might for now be a better idea to use two separate Git checkouts/clones, one for 32- and one for 64-bit builds...
Best regards,
Carsten
User avatar
Carsten
Site Admin
Posts: 2132
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Scons can't find my compiler

Postby Carsten » 2014-04-12, 16:41

Hi SoulRider,

out of curiosity I just tried a Windows 64-bit build myself:

  1. upgraded my SCons to currently latest (2.3.1),
  2. cloned a new copy of Cafu into a new, separate directory,
  3. checked out branch entity-component-system,
  4. removed flags /WX from SConstruct file as described above,
  5. running scons (or rather, scons -Q for a little less verbose output) completed successfully (wxWidgets is build in common, not in architecture specific directories, so that 32- and 64-bit builds cannot coexist next to each other, I'll investigate this later),
  6. ran

    Code: Select all

    build\win32\vc11\x86_amd64\debug\CaWE\CaWE.exe
    in order to load and save one map, e.g. "BPRockB", in order to convert it into the new map file format that comes with the Component System (first "Open", then "Save As...", overwriting the previously opened BPRockB.cmap file in Games/DeathMatch/Maps), then quit CaWE again,
  7. edited file Games/DeathMatch/compileMaps.py, replacing line

    Code: Select all

    for arch in ["x64", "x86"]:
    with

    Code: Select all

    for arch in ["x64", "x86_amd64", "x86"]:
    (another item that should not be necessary and needs investigation),
  8. compiled map "BPRockB" with command

    Code: Select all

    python Games\DeathMatch\compileMaps.py BPRockB
  9. started the Cafu Engine with command

    Code: Select all

    build\win32\vc11\x86_amd64\debug\Ca3DE\Cafu.exe -noFS
    (the -noFS is just for "no fullscreen" == "windowed" mode),
  10. it works! :wohow:

Although this works and I'm quite happy about this, please let me emphasize again that under Windows, we 99% of the time use the 32-bit builds only (the work-arounds and open issues in steps 4, 5 und 7 in the above list are a strong indication of that...), and I still recommend that you use, at least for now, the 32-bit builds for normal work. :cheesy:
Best regards,
Carsten
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-13, 01:42

Thanks Carsten, I really appreciate this.

I can make do with building 32-bit for now, but it would certainly be nice to get a 64-build working successfully too. Who knows how much longer legacy support for 32 bit programs in 64-bit architecture is going to last...
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-13, 02:25

OK, I followed your instructions to build 32-bit and the engine compiled, but I now get errors when trying to launch anything.

If I browse to:

Code: Select all

build\win32\vc11\x86\debug\CaWE\CaWE.exe

and try to run it, I get the error:

Code: Select all

Could not find directory "CaWE" in (path to \CaWE).


It seems to be looking for an additional level of the folder CaWE inside the directory listed above.

If I browse to:

Code: Select all

\build\win32\vc11\x86\debug\Ca3DE\Cafu.exe

and try to run it, I get the error:

Code: Select all

Cafu Initialization Error - class std::runtime_error
Could not find a renderer that is supported on your system.


Sorry for the continuous questions, they will die down eventually...
User avatar
Carsten
Site Admin
Posts: 2132
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Scons can't find my compiler

Postby Carsten » 2014-04-13, 14:18

SoulRider wrote:it would certainly be nice to get a 64-build working successfully too.

Yes, I agree. I cannot immediately address is myself though, but to make sure that this does not get forgotten, I just filed ticket #140.

Who knows how much longer legacy support for 32 bit programs in 64-bit architecture is going to last...

Oh, I'd not be worried about that. Considering that most 16-bit programs are still supported even today... :cheesy:

SoulRider wrote:OK, I followed your instructions to build 32-bit and the engine compiled, but I now get errors when trying to launch anything.

If I browse to:

Code: Select all

build\win32\vc11\x86\debug\CaWE\CaWE.exe

and try to run it, I get the error:

Code: Select all

Could not find directory "CaWE" in (path to \CaWE).


It seems to be looking for an additional level of the folder CaWE inside the directory listed above.

That's right, because the working directory should be the top-level directory ., not .\build\win32\vc11\x86\debug\CaWE. But you're by far not the only one who has experienced this, even though it is documented at Running the new Programs.

I've therefore also filed ticket #141, because I think that this is something that we can do better during program init. :-D

Sorry for the continuous questions, they will die down eventually...

Don't worry. In fact, I'm happy that you post them, because if you didn't, how could I know about things that only work for me, but not for others? :up:
Best regards,
Carsten
SoulRider
Posts: 95
Joined: 2014-04-06, 00:16

Re: Scons can't find my compiler

Postby SoulRider » 2014-04-13, 15:01

Carsten, I think the issue has something to do with the instructions don't take into consideration the Target Build Type (x86) for example. In the instructions, you mention paths like this:

Code: Select all

build\win32\vc9\debug\CaWE\CaWE.exe

But my system has built a path like this:

Code: Select all

build\win32\vc11\x86\debug\CaWE\CaWE.exe


It doesn't seem to matter how I re-arrange the files, I get the same error.

Return to “Cafu Engine Support and Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests