Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with building on Windows 7 x64 #11

Open
Xploit3r opened this issue Jan 6, 2020 · 1 comment
Open

Issues with building on Windows 7 x64 #11

Xploit3r opened this issue Jan 6, 2020 · 1 comment

Comments

@Xploit3r
Copy link

Xploit3r commented Jan 6, 2020

I receive an error when I run the go build command. The error is related to GCC for the component: o365-attack-toolkit/vendor/github.com/mattn/go-sqlite3

More details of the bug are mentioned later in this post.

I am using Windows 7 x64 OS.

I used the following steps:

  1. Installed Go in the path: C:\go

  2. Created a directory called C:\go-work

Added the above path to GOPATH environment variable for the current user

echo %GOPATH% shows the output as: "C:\go-work"

  1. cd %GOPATH%

  2. git clone https://github.com/mdsecactivebreach/o365-attack-toolkit

  3. cd o365-attack-toolkit

  4. dep ensure command here gives me the following error:

root project import: C:\go-work\o365-attack-toolkit is not within any GOPATH/src

To resolve the above issue, I moved the entire o365-attack-toolkit directory to the c:\go-work\src

  1. cd C:\go-work\src\o365-attack-toolkit

Now, when I run dep ensure command, it returns back to the prompt (so maybe it ran successfully?)

  1. go build

Above command gives the following error:

# o365-attack-toolkit/vendor/github.com/mattn/go-sqlite3
/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
go: failed to remove work dir: GetFileInformationByHandle C:\Users\username\AppData\
Local\Temp\go-build819327598\NUL: Incorrect function.

For GCC support on Windows 7 x64, I installed Cygwin x64 and then used the following command to install GCC and dependencies:

C:\cygwin64>setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel

I added the C:\cygwin64\bin folder to the PATH environment variable as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants