forked from miracl/MIRACL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
msvisual.txt
142 lines (94 loc) · 5.46 KB
/
msvisual.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
To create MIRACL applications under Microsoft Windows using Microsoft C++
version 6.0, follow these steps. Remember a "Release" build will be
faster than a "Debug" build. For MS VC++ .NET see below.
First build the library from the command line, using one of the supplied
batch files, like ms32doit.bat, or ms64doit.bat for a 64-bit build.
1. Create a new empty project of type "Win32 Console Application"
Give it the name of the associated main project file, e.g. limlee
for limlee.cpp
2. Click on "Project", and then on "Add to Project", and then on "Files"
3. Select "library files (.lib)" from the "Files of type" drop-down list.
Look for the precompiled MIRACL library file miracl.lib, and insert it
into the project.
4. Add the main project file (e.g.limlee.cpp) into the project.
5. Only if it is a C++ main project file, also add into the project any
other needed files, like big.cpp/zzn.cpp etc. Those required are
specified in the comments at the start of the main project file, e.g.
* Requires: big.cpp zzn.cpp
This step is not required for C projects.
6. Now click on "Project" and then on "Settings". Click the C/C++ tab and
select the "preprocessor" category. Find the box "Additional Include
Directories", and specify a path to the miracl header files,
mirdef.h/miracl.h/big.h etc..
7. Make sure that any files needed by the application are available in the
directory from which the application is run. For example *.key *.dss,
or *.ecs files
8. Now build and run the project.
To create a new version of the MIRACL library using Visual Studio,
1. Compile and run the config.c utility, and rename the generated mirdef.tst
to mirdef.h
Note that Microsoft C has a 64-bit integer data type called "__int64"
(although with newer versions of the compiler now its OK to refer to it
as "long long")
2. Create a new project of type "Win32 Static Library". Then click on "Finish".
3. Add in the appropriate files mr*.c. The ones required are those listed in
miracl.lst (also generated by the config utility).
4. Now click on "Project" and then on "Settings". Click the C/C++ tab and
select the "preprocessor" category. Find the box "Additional Include
Directories", and specify a path to the miracl header files
mirdef.h and miracl.h
5. Now build the project and create the MIRACL library.
--------------------------------------------------------------------------------------------
To create MIRACL applications under Microsoft Windows using Microsoft C++
.NET, follow these steps.
1. Click on New and Project, and select "Visual C++ Projects", "Win32",
select "Win32 Console Project", and give the project name, for example
limlee, for the limlee.cpp example. Click on Finish.
2. Now things get a little tricky. An empty limlee.cpp file is provided.
You must now cut and paste from the Miracl provided file limlee.cpp into
this one. Note that the main program is now called _tmain.
3. Click on Project, and on "Add existing Item", and Select "All files" from
the "Files of type" drop-down list.
Look for the precompiled MIRACL library file miracl.lib, and insert it
into the project.
4. Only if it is a C++ main project file, also add into the project any
other needed files, like big.cpp/zzn.cpp etc. Those required are
specified in the comments at the start of the main project file, e.g.
* Requires: big.cpp zzn.cpp
This step is not required for C projects. Use "Project", and "Add existing
Item".
5. Click on Project and then "Properties". Open up the C++ Tab, go to "Precompiled
Headers", and select "Not using precompiled headers" from the drop-down box.
Open the "General" Tab, and specify a path to the miracl header files, mirdef.h,
miracl.h and big.h etc.
6. Build the project and run it by clicking "Debug" and "Start". The program runs
to completion and exits.
To create a new version of the MIRACL library, first create a suitable
mirdef.h as above, then
1. Click on New and Project, and select "Visual C++ Projects", "Win32",
enter the name Miracl and click on "Win32 Project" and then OK.
2. Click on "Application Settings", and then select "Static Library".
Then click on Finish
3. Add in the appropriate files mr*.c. (Project followed by "Add Existing Items").
4. Click on Project and then "Properties". Open up the C++ Tab, go to "Precompiled
Headers", and select "Not using precompiled headers" from the drop-down box.
Open the "General" Tab, and specify a path to the miracl header files, mirdef.h
and miracl.h
5. Now build the project.
--------------------------------------------------------------------------------------
If using MIRACL within an MFC based Win32 project, here are some hints.
1. Build a MIRACL library with MR_NO_STANDARD_IO defined in mirdef.h
The config.c utility can be used as usual to create a suitable mirdef.h
2. If using the C++ MIRACL classes, don't forget to change the default project
settings for the MIRACL implementation files such as big.cpp to "not using
pre-compiled headers".
3. Don't forget that MIRACL is a C library, not C++. To call MIRACL routines
directly from a C++ program you must:-
extern "C"
{
#include "miracl.h"
}
If using C++, its probably preferable to access MIRACL via the C++ wrapper
classes such as implemented by big.h/big.cpp. See big.h file for more tips.
4. To display a big number, convert it first to a string. See the comments at
the start of big.h