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

Find way to build against mcrypt on 64-bit windows #31

Open
c215 opened this issue Sep 22, 2012 · 9 comments
Open

Find way to build against mcrypt on 64-bit windows #31

c215 opened this issue Sep 22, 2012 · 9 comments
Labels

Comments

@c215
Copy link

c215 commented Sep 22, 2012

Hello,

I have a problem for installing mcrypt correctly on windows 7 64bit. I tried to download the mcrypt-2.6.7-win32.zip, it is just an exe i can use with the terminal. I also tried to download the libmcrypt library but i have no idea what i need to do after that. I didn't find any answer in google so I'd love your help.

How do I install this library on windows 7 64bit?

@qdot
Copy link
Member

qdot commented Nov 1, 2012

Hmm. That's... a really good question. I got emokit building on 32-bit XP because that's just what I had a VM kickin' around for, and that was using the prebuild mcrypt that it looks like every windows php installation on the planet uses. So we need to find a better solution for x64. It's definitely on the todo list.

@Happy0
Copy link

Happy0 commented Jan 15, 2013

Qdot: You mentioned that you got emokit working on windows using the mcrypt dll which comes with php. Where did you put this dll such that emokit's cmake stuff can find it - or did you have to modify the cmake file or use a different build process?

Edit 1: I discovered how to specify where the hidapi and mcrypt dlls are in the cmake-gui and how to generate .sln files (for visual studio.) When building in visual studio I now have these issues: http://pastie.org/private/ielepopqhf1dvzkjdpx2g

Edit 2: Sorted the include issues by putting mcrypt.h in the include directory and hidapi.h in /include/hidapi/. I assume the remaining errors are some subtlety involving windows. Shall look into it...

@xenocyon
Copy link

Happy0: could you please describe the details of "Edit 1" in your post above? Much appreciated!

@Happy0
Copy link

Happy0 commented Jan 29, 2013

Sure, no problem! I should have been more clear in anticipation of this happening, actually.

Using the CMake GUI, specify the source path (the emokit root directory) and where you wish emokit to be built (in my case, in a 'build' folder i made in the route of the emokit directory.) Press configure, select your compiler (in my case Visual Studio 10.)

When you hit configure again, I believe it will ask you to specify the path to hidapi. Hidapi can be found on github, and it has a .sln file you can open to build it in visual studio and produce the required .lib and .dll files by building the project. Once those are specified, and you hit configure, I think it then asks for the mcrypt path. I found the mcrypt .lib and .dll files online somewhere (if you have difficulty finding them, I can upload them somewhere.) Then when you hit generate, cmake should produce the .sln files for emokit in the build folder. You can then build the project using visual studio using the .sln file...

Let me know if you need any help - this took me a couple of days. Good luck!

@xenocyon
Copy link

Thanks! I have no problem with hidapi. However, I am unable to find mcrypt.h and mcrypt.lib. Right now, I have the following config options in cmake - the question marks are obviously stuff I need to figure out:

CMAKE_INSTALL_PREFIX:PATH=C:/Users/mishra/Downloads/emokit-master/emokit-master/cmake_modules
HIDAPI_INCLUDE_DIR:PATH=C:/Users/mishra/Downloads/hidapi-master/hidapi-master
HIDAPI_LIBRARY:FILEPATH=C:/Users/mishra/Downloads/hidapi-master/hidapi-master/windows/Debug/hidapi.lib
Mcrypt_LIB:FILEPATH=???
Mcrypt_INCLUDE_DIR:PATH=???

@xenocyon
Copy link

OK, I downloaded libmcrypt, and am using the following options:

Mcrypt_LIB:FILEPATH=C:/Users/mishra/Downloads/libmcrypt-2.5.8.tar/libmcrypt-2.5.8/COPYING.LIB
Mcrypt_INCLUDE_DIR:PATH=C:/Users/mishra/Downloads/libmcrypt-2.5.8.tar/libmcrypt-2.5.8/include

With this, the correct .h files are getting picked up, at least; not fully sure about the lib files.

Now, after cmake and trying to build emokit.sln, I'm getting errors compiling contact.c and emokitd.c. They look very similar to the ones you mentioned. How did you get them resolved?

My compiler output is here: http://pastie.org/5924729

Thanks very much for the help, I really appreciate it!

@Happy0
Copy link

Happy0 commented Jan 29, 2013

If you don't have any luck with the mcrypt lib/dll, here is the copy of the ones I found: https://dl.dropbox.com/u/35473318/dlls.zip

As for those compiler errors, those are indeed familiar. Turns out that the compiler must not be using the C99 C standard by default (which allows you to mix declarations and code.) There must be a flag somewhere in visual studio to compile with respect to this standard instead, but I didn't have a look... However, to get round it quickly I just declared everything at the top of their respective functions. Like this, for example:

http://pastie.org/5935993

No problem, I'm glad I can be helpful for a change rather than burdening this community with questions :P.

@xenocyon
Copy link

Thanks - this helps a lot (both of those things)! I still need to do more work to see if everything's working, but at least I don't see any build errors now.

@Happy0
Copy link

Happy0 commented Jan 31, 2013

No problem! Let me know how you get on :P

@ghost ghost assigned qdot Jun 22, 2016
@qdot qdot removed their assignment Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants