Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#23783 closed defect (fixed)

Can't build Tor with mingw32 on Windows 7

Reported by: Bizarre™ Owned by:
Priority: High Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Normal Keywords:, windows, mingw
Cc: Actual Points:
Parent ID: Points: 0.5
Reviewer: Sponsor:


Hi there,

I attempted to build Tor with mingw32, but it's giving me the following message:

configure: Now, we'll look for OpenSSL >= 1.0.1
checking for openssl directory... configure: WARNING: Could not find a linkable openssl.  If you have it installed somewhere unusual, you can specify an explicit path using --with-openssl-dir
configure: error: Missing libraries; unable to proceed.

The previous versions of Tor didn't have this error. The last version I successfully built was I'm guessing that it has something to do with TLSv1_1_method() because it's detecting the 1.0.0 version of openssl that is built in with mingw32 and not the 1.0.2l version I installed. The previous versions always detected the new version of openssl I installed so I'm not sure why it can't detect it now. I even tried reinstalling openssl, but I'm still receiving the same message above. Please help. Thanks.

Child Tickets

Attachments (1)

config.log (163.7 KB) - added by Bizarre™ 3 years ago.

Download all attachments as: .zip

Change History (17)

Changed 3 years ago by Bizarre™

Attachment: config.log added

comment:1 Changed 3 years ago by Bizarre™

Priority: MediumHigh
Version: Tor:

comment:2 Changed 3 years ago by nickm

Milestone: Tor: 0.3.2.x-final

comment:3 Changed 3 years ago by Bizarre™


I tried building Tor, but I'm still getting the same error.

comment:4 Changed 3 years ago by arma

I assume this happened because of the fix for Homebrew OpenSSL locations in #23602 (which went into

comment:5 Changed 3 years ago by teor

Status: newneeds_information

What paths are these OpenSSL libraries installed in?

configure:9264: gcc -o conftest.exe -g -O2 -I/usr/local/ssl/include  -I${top_srcdir}/src/common -L/usr/local/ssl/lib  conftest.c -lpthread  -lssl -lcrypto -lgdi32 >&5
C:/MinGW/msys/1.0/local/ssl/lib/libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x12f): undefined reference to `shutdown@8'
C:/MinGW/msys/1.0/local/ssl/lib/libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x13d): undefined reference to `closesocket@4'
C:/MinGW/msys/1.0/local/ssl/lib/libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x16d): undefined reference to `WSASetLastError@4'
C:/MinGW/msys/1.0/local/ssl/lib/libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x18d): undefined reference to `recv@16'
C:/MinGW/msys/1.0/local/ssl/lib/libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x1c9): undefined reference to `WSAGetLastError@0'
collect2.exe: error: ld returned 1 exit status

Either we used to do a check for the OpenSSL binary path, and we're skipping it, or we used to pass the right libraries on mingw32, and we don't any more.

comment:6 Changed 3 years ago by Bizarre™

Hi, apologies for the delayed response.

@arma: Yes, that's it. In the previous versions, I didn't see the function referring to TLSv1_1_method(), so I was able to build Tor successfully.

@teor: The path you quoted is the 1.0.2l version. However, there's also a built in version of 1.0.0 (C:\MinGW\msys\1.0\bin\openssl.exe). This is most likely the file that Tor detects.

I already tried uninstalling the built in version, but the issue persists.

By the way, the compiler I'm using can be found here:

Last edited 3 years ago by Bizarre™ (previous) (diff)

comment:7 Changed 3 years ago by teor

Status: needs_informationnew

The configure test has found the correct OpenSSL, but the linker command line appears to missing the winsock library "Ws2_32", which is a dependency of libcrypto.

We can try patching configure to include -lWs2_32 whenever it links libcrypto, and see how far that gets us.

comment:8 Changed 3 years ago by Bizarre™

Hi, teor. Thanks for the update. I'll try building Tor again (as I can see a new version in the distro) and post the result here once I'm finished.


Oops, it looks like I jumped the gun because I'm still getting the same error. I thought the patch was already implemented in Tor LOL. Anyway, I'll wait for the next version.

Last edited 3 years ago by Bizarre™ (previous) (diff)

comment:9 Changed 3 years ago by teor

Keywords: windows mingw added
Points: 0.5

Sorry about that, adding the dependency was just my suggestion.
I'm not familiar enough with Windows and our configure script to be sure it will fix this, but we should give it a shot.

If someone puts a patch in a git branch, can you test if it compiles and runs?
It would help us to know whether the patch is enough.

comment:10 Changed 3 years ago by Bizarre™


No problem. I'll try to build Tor when the patch becomes available.

comment:11 Changed 3 years ago by cypherpunks

Hi Bizarre,
are you by any chance the operator behind the relays on IP ( on Windows)

You don't have to say if you are but if you are we would like to let you know that
there is a problem with the relay at that IP, because it re-keys frequently and is is not very useful to tor clients.

I'm trying to reach the operator via this ticket here because the relay in question has no contact info set.

Sorry for using this ticket if it is unrelated to you.

comment:12 Changed 3 years ago by Bizarre™


Sorry, but I'm not the one behind that IP address. I'm normally behind a VPN, but this is the first I've seen that IP address.

Last edited 3 years ago by Bizarre™ (previous) (diff)

comment:13 Changed 3 years ago by nickm

Status: newneeds_review

I have a quick branch for review as bug23783.

comment:14 Changed 3 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

dgoulet says "looks plausible", so merging into maint-0.3.2.

comment:15 Changed 3 years ago by Bizarre™


Hi, guys. I just want to let you know that I was able to build Tor Thank you very much and keep up the good work :D

comment:16 Changed 3 years ago by nickm

Thanks for testing it out, Bizarre!

Note: See TracTickets for help on using tickets.