[Solved] Help Building Love2D from Source

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
coldmoose
Prole
Posts: 2
Joined: Fri Jul 27, 2018 2:05 am

[Solved] Help Building Love2D from Source

Post by coldmoose »

I am trying to build Love2D from the source as is, then I'm going to try building it with some power patches, but I'm running into some problems so hopefully someone here has done it and can help.

I'm following the steps on https://love2d.org/wiki/Building_L%C3%96VE and then on https://bitbucket.org/rude/megasource. I'm on Windows, I have downloaded Visual Studio 2017, mercurial, and cmake.

I'm running the following commands from within the "Select Developer Command Prompt for VS 2017"

Code: Select all

hg clone https://bitbucket.org/rude/megasource megasource
cd megasource
hg clone https://bitbucket.org/rude/love libs/love
cmake -G "Visual Studio 15" -H. -Bbuild
cmake --build build --target love/love --config Release
After running the first cmake there are multiple tests that fail and files that are not found. Here are some examples.

Code: Select all

-- Performing Test HAVE_BITSCANFORWARD64_INTRINSIC
-- Performing Test HAVE_BITSCANFORWARD64_INTRINSIC - Failed
-- Performing Test HAVE_BITSCANFORWARD_INTRINSIC
-- Performing Test HAVE_BITSCANFORWARD_INTRINSIC - Success
-- Looking for sysconf
-- Looking for sysconf - not found
-- Looking for aligned_alloc
-- Looking for aligned_alloc - not found
After running the second cmake it ends with this many errors. Heres an example of one of the errors.

Code: Select all

    92 Warning(s)
    121 Error(s)

Code: Select all

  c:\users\xxx\documents\megasource\libs\love\src\common\stringmap.h(33): error
C3190: 'void std::vector<std::string,std::allocator<_Ty>>::emplace_back(const char
 *const &)' with the provided template arguments is not the explicit instantiation
 of any member function of 'std::vector<std::string,std::allocator<_Ty>>' [C:\User
s\xxx\Documents\megasource\build\love\liblove.vcxproj]
The contents of build/love/Release are the following.

Code: Select all

love_3p_box2d.lib     love_3p_lodepng.lib    love_3p_physfs.lib
love_3p_ddsparse.lib  love_3p_lua53.lib      love_3p_wuff.lib
love_3p_enet.lib      love_3p_luasocket.lib  love_3p_xxhash.lib
love_3p_glad.lib      love_3p_lz4.lib
love_3p_glslang.lib   love_3p_noise1234.lib
Final note, I plan on using power patches from http://lua-users.org/wiki/LuaPowerPatches.
Last edited by coldmoose on Thu Aug 09, 2018 1:18 am, edited 1 time in total.
skepci
Prole
Posts: 1
Joined: Fri Aug 03, 2018 2:42 am

Re: Help Building Love2D from Source

Post by skepci »

I am building the same way and running into the same StringMap error (pasted below). I just commented that line of code out and was able to build ok.

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	C3190	'void std::vector<std::string,std::allocator<_Ty>>::emplace_back(const char *const &)' with the provided template arguments is not the explicit instantiation of any member function of 'std::vector<std::string,std::allocator<_Ty>>'	liblove	megasource\libs\love\src\common\StringMap.h	33	
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Help Building Love2D from Source

Post by bartbes »

I remember looking at this a while back, it looks like msvc changed its standard library in an incompatible way again. Omitting that line is indeed a possible fix, and it might be the one I end up going for.
coldmoose
Prole
Posts: 2
Joined: Fri Jul 27, 2018 2:05 am

Re: Help Building Love2D from Source

Post by coldmoose »

I ended up getting help last week on the discord! Here are the steps I used, hopefully this helps someone in the future.

1) Used Visual Studio 2017
2) Using the steps on bitbucket to clone the repository, done in the developer command prompt for VS 2017 and everything after uses this as well
3) Before the first cmake, line 104 in CMakeLists.txt needs to be fixed Points to the wrong directory
old < get_filename_component(VS_REDIST_DIR ${VSCOMNTOOLS}/../../VC/redist/${MEGA_ARCH}/Microsoft.VC${VSVERSION}.CRT ABSOLUTE)
new > get_filename_component(VS_REDIST_DIR ${VSCOMNTOOLS}/../../VC/Redist/MSVC/14.14.26405/${MEGA_ARCH}/Microsoft.VC${VSVERSION}.CRT ABSOLUTE)
4) Run cmake -G "Visual Studio 15" -H. -Bbuild using Visual Studio 15 instead of 12
5) Before the last cmake, the following lines need to be commented out
libs\love\src\common\StringMap.h:32
libs\love\src\common\StringMap.h:33
libs\love\src\common\StringMap.cpp:25
6) Profit
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests