Author Topic: Build on Windows without VS  (Read 19047 times)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3347
    • View Profile
Re: Build on Windows without VS
« Reply #15 on: August 19, 2018, 06:38:57 pm »
Yes, of course. make -f Makefile.gcc-pch clean before switching to the other makefile.
But it not look like this, because if you do OXCE+ build your compilation would return error not linking stage.

Offline BTAxis

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Build on Windows without VS
« Reply #16 on: August 19, 2018, 07:11:57 pm »
I'm pretty sure I am not editing Makefile.mingw correctly (I don't really speak make). You were right about not cleaning properly earlier though, because it turns out the edit to Text.cpp/h I mentioned was not necessary.

Anyway this is the makefile I'm attempting to use (I only edited the paths to SDL, Boost and YAML). Again, fairly sure it's to do with YAML because the makefile points to sources that don't exist.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3347
    • View Profile
Re: Build on Windows without VS
« Reply #17 on: August 19, 2018, 08:01:03 pm »
OXCE compile yaml from sources: `git clone https://github.com/jbeder/yaml-cpp.git` (you need run this command in correct dir to match makefile)

Offline BTAxis

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Build on Windows without VS
« Reply #18 on: August 19, 2018, 10:25:09 pm »
OXCE compile yaml from sources: `git clone https://github.com/jbeder/yaml-cpp.git` (you need run this command in correct dir to match makefile)

Actually no, that's not needed with msys2. It provides the yaml-cpp package via its package manager.

I've worked out how to do it now. This makefile will build the game without fuss. Okay, a couple of warnings. But it works.

Thanks for your input Yankes, you've been a great help.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3347
    • View Profile
Re: Build on Windows without VS
« Reply #19 on: August 19, 2018, 11:24:15 pm »
And what version is avaialbe in this package? One reason why I use sources from github is because some environments had outdated version.
As bonus new version use C++11 and do not depend on Boost.

Offline BTAxis

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Build on Windows without VS
« Reply #20 on: August 20, 2018, 11:45:42 am »
And what version is avaialbe in this package? One reason why I use sources from github is because some environments had outdated version.
As bonus new version use C++11 and do not depend on Boost.

Code: [Select]
$ pacman -Ss yaml-cpp
mingw32/mingw-w64-i686-yaml-cpp 0.6.2-1 [installed]
    A YAML parser and emitter in C++ matching the YAML 1.2 spec (mingw-w64)
mingw32/mingw-w64-i686-yaml-cpp0.3 0.3.0-2
    A YAML parser and emitter in C++ matching the YAML 1.2 spec (mingw-w64) - old version
mingw64/mingw-w64-x86_64-yaml-cpp 0.6.2-1 [installed]
    A YAML parser and emitter in C++ matching the YAML 1.2 spec (mingw-w64)
mingw64/mingw-w64-x86_64-yaml-cpp0.3 0.3.0-2
    A YAML parser and emitter in C++ matching the YAML 1.2 spec (mingw-w64) - old version

It seems to work out for me, I've played on my binary and noticed no issues.
Thanks for the tip about Boost, removing it worked just fine.

Offline Jakeoff

  • Squaddie
  • *
  • Posts: 1
    • View Profile
    • Microsoft Office Visio
Re: Build on Windows without VS
« Reply #21 on: October 21, 2019, 11:02:40 pm »
Development in Visual Studio is not an easy task. Constantly a bunch of bugs

Offline Lewis-H

  • Squaddie
  • *
  • Posts: 1
    • View Profile
Re: Build on Windows without VS
« Reply #22 on: September 30, 2020, 01:25:41 pm »
First, you need to get the latest msbuild.
You can get it from Visual Studio 2017 download page.  On the bottom, click “Other Tools and Frameworks”, then choose “Build Tools for Visual Studio 2017”.
Direct download link

Start that setup file (vs_buildtools_xxx.exe), and choose “Web Development Build Tools”.



After installing, you will get a new command prompt in the start menu, called “Developer Command Prompt for VS 2017”.  Use it to start your command prompt, as it will add to path all required folders to run msbuild from anywhere.

Go to your folder with your solution sln file, and just type msbuild.  It will automatically start building the sln files.

If you use nuget packages, you will get errors about missing packages.  You may have read somewhere that you only need to type “msbuild /t:restore”, but I think that it’s only works for .NET Core solutions, it does nothing for Studio 2017 classic framework projects.

Now you need an additional file: nuget.exe, 

I use the latest version, 4.1.  The download is not a setup, it’s directly the nuget executable.  Only 1 file is needed.

I suggest to save it somewhere available in your path from DOS, maybe at the same place that msbuild was installed, [C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin].

Now, get back to your sln folder, and just type “nuget restore”.  The “packages” folder will be created, and required nuget packages downloaded there.

You’re ready to try msbuild again.

Offline dhinvid

  • Squaddie
  • *
  • Posts: 1
    • View Profile
    • instasave
Re: Build on Windows without VS
« Reply #23 on: August 03, 2022, 01:44:35 pm »
I have in fact succeeded in building on Windows without VS. For this I used msys2/MinGW-w64.