liorko liorko - 3 months ago 19
C++ Question

compiling and linking miracl c++

I have a problem with compiling and linking miracl library.

When I'm trying to compile and link miracl while using cmake I'm getting weird error messages about the miracl.h file like :

error: expected initializer before ‘mr_large’


CMakeLists.txt:

cmake_minimum_required(VERSION 3.0)
project(OS-PSI)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -maes -O3 -mavx")

include_directories($ENV{HOME}/libscapi/lib/Miracl/include)

find_library(
LIBMIRACL
NAMES miracl
PATHS $ENV{HOME}/libscapi/install/lib/
NO_DEFAULT_PATH
)


set(SOURCE_FILES main.cpp)
add_executable(OS-PSI ${SOURCE_FILES})

target_link_libraries(OS-PSI ${LIBMIRACL})


main.cpp

#include <iostream>
#include <miracl.h>
#include <mirdef.h>
#include <ecn.h>
#include <big.h>


int main(int argc, char *argv[])
{
Big big1(12);
int partyId = atoi(argv[1]);
return 0;
}


All I'm trying to do is to create a simple program that using miracl library

Answer

I found the problem after i post it on miracl GitHub at this link

The solution is to change __int64 to long long at mirdef.h

Comments