Compiling and installing Hugo from source on Windows is getting a gcc error and fails

Hello,

I’m trying to install Hugo from source on a Windows machine where I already have Git and Go installed, where I used the instructions from the docs:

mkdir $HOME/src
cd $HOME/src
git clone https://github.com/gohugoio/hugo.git
cd hugo
go install --tags extended

However, I get the following error:

C:\tools\Hugo\src (master -> origin)
λ go install --tags extended
# github.com/wellington/go-libsass/libs
exec: "gcc": executable file not found in %PATH%

What should I do as a workaround?

Thank you for the support,
Carlos Soares.

From issues: https://github.com/gohugoio/hugo/issues/5798

Update 1

I have now installed gcc and g++ using cygwin but still some issue persists:

λ go install --tags extended
# github.com/gohugoio/hugo
C:\tools\Go\pkg\tool\windows_amd64\link.exe: running g++ failed: exit status 1
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingwex
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lmingw32
collect2: error: ld returned 1 exit status

Can someone help?

The main issue that I’m trying to solve is to have the Hugo extended edition on Windows. So I’m trying to compile it myself.

Update 2

I tried to reinstall Cygwin with the Dev modules but now I get the following error:

λ go install --tags extended
# github.com/gohugoio/hugo
C:\tools\Go\pkg\tool\windows_amd64\link.exe: running g++ failed: exec: "g++": executable file not found in %PATH%

Hi @cmpsoares91, is downloading the Windows 64 bit Hugo Extended binary an option for you?

Well it is, but the version I found so far didn’t work either, can you point me out a working version of the extended binary?

This is the one I’m talking about https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_extended_0.54.0_Windows-64bit.zip

When you say it didn’t work, what do you mean?

Downloaded it from the website, wrong one I suppose, let me try…

It worked! Thank you!

Sorry for the noob issue, just started with Hugo yesterday! :wink: