Error compiling OpenSSL with MinGW/MSYS
Asked Answered
R

6

7

Download source files from official OpenSSL site. I follow the INSTALL.M32 file in OpenSSL folder. I open msys.bat, go to the OpenSSL folder, then type

$ ./config

It says "Configured for MinGW", than I type

$ make

and after few minutes receive error:

md2test.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
Rheumatic answered 31/8, 2011 at 11:9 Comment(0)
R
3

In my case the problem was that few test files (3 as far as I remember) had instead of C++-code the name of file (something like dummitest.c). I copy-paste the right code to that files from files from other folder, but with the same name, and everything went fine.

Rheumatic answered 7/9, 2011 at 7:48 Comment(1)
This sounds exactly like a problem with symbolic links. The other affected files are rc5test.c and jpaketest.c.Drum
C
15

I simply opened the files that were causing the error (/test/"md5test.c; rc5test.c; jpaketest.c") and replaced the line

dummytest.c

to

#include "dummytest.c"

It's the same solution as stated above, except it's a bit faster...

Colloquial answered 4/12, 2011 at 15:37 Comment(1)
typo: /test/"md2test.c with a 2 instead of a 5 +1Meisel
M
14

The problem is that md2test.c is actually a symbolic link, or symlink to dummytest.c.

If you extracted openssl-1.0.1c.tar.gz with anything other than

tar xf openssl-1.0.1c.tar.gz

then these symlinks were not preserved. On Cygwin it works after that; not sure about MinGW.

Monteverdi answered 13/5, 2012 at 1:48 Comment(1)
what helped was tar -xvzf openssl-1.0.1c.tar.gz just to repackage it but this time with dereference tar option "-h" tar -cvhzf openssl.tar.gz openssl-1.0.1 and then extract it once again. Stupid but it works. Don't know how to dereference the files while extractingDutton
R
3

In my case the problem was that few test files (3 as far as I remember) had instead of C++-code the name of file (something like dummitest.c). I copy-paste the right code to that files from files from other folder, but with the same name, and everything went fine.

Rheumatic answered 7/9, 2011 at 7:48 Comment(1)
This sounds exactly like a problem with symbolic links. The other affected files are rc5test.c and jpaketest.c.Drum
E
2

What program did you use to decompress 'openssl-1.0.0x.tar.gz'? 7-zip is a great program, but it seems there's a bug.

Use tar or other decompressor such as BreadZip.

tar zvxf openssl-1.0.0x.tar.gz

It's the same solution as stated above, except it's a bit faster... :)

Expediency answered 7/2, 2012 at 0:5 Comment(0)
S
1

The problem is a symbolic link in the archive that MinGW/MSYS does not seem to understand.

You can work around it by using the --derefence (-h) option when extracting.

For example tar -xzvfh archive.tar.gz

from http://www.gnu.org/software/tar/manual/html_node/dereference.html:

When reading from an archive, the --dereference' (-h') option causes tar to follow an already-existing symbolic link when tar writes or reads a file named in the archive.

Skyscape answered 20/6, 2015 at 12:43 Comment(0)
C
0

I am having the same problem. As the problem is while building the tests, I just did not make them:

make Makefile openssl.pc libssl.pc libcrypto.pc build_libs build_apps build_tools

Is a horrible solution but it seems to work. You get the libraries and the tools, but not the test suite.

I hope someone gives a better answer and/or fixes the problem with the code if there is any.

Corrianne answered 6/9, 2011 at 19:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.