make build EC GF2m simple method was not declared in this scope error in centos7

0 votes

When I compile the code I get an error telling me my 'EC_GROUP_set_curve_GF2m' function was not declared in this scope. 

from:github bubichain-v3

My Centos 7 is newly installed and installed software package:

sudo yum install -y automake autoconf libtool g++ libssl-dev cmake libbz2-dev python

Error info:

/home/bubichain-v3/src/utils/ecc_sm2.cpp: In static member function ‘static EC_GROUP* utils::EccSm2::NewGroup(utils::EccSm2::GROUP_TYPE, std::string, std::string, std::string, std::string, std::string, std::string)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:211:48: error: ‘EC_GF2m_simple_method’ was not declared in this scope
     group = EC_GROUP_new(EC_GF2m_simple_method());
                                                ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:216:53: error: ‘EC_GROUP_set_curve_GF2m’ was not declared in this scope
     if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) {
                                                     ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:221:63: error: ‘EC_POINT_set_affine_coordinates_GF2m’ was not declared in this scope
     EC_POINT_set_affine_coordinates_GF2m(group, G, xG, yG, ctx);
                                                               ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In static member function ‘static std::string utils::EccSm2::getZA(EC_GROUP*, std::string, const EC_POINT*)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:255:66: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
    EC_POINT_get_affine_coordinates_GF2m(group, pkey, xA, yA, NULL);
                                                                  ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:264:62: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
    EC_POINT_get_affine_coordinates_GF2m(group, G, xG, yG, ctx);
                                                              ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘bool utils::EccSm2::From(std::string)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:334:71: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
     if (!EC_POINT_get_affine_coordinates_GF2m(group_, pkey_, x, y, ctx)) {
                                                                       ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘bool utils::EccSm2::NewRandom()’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:376:71: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
     if (!EC_POINT_get_affine_coordinates_GF2m(group_, pkey_, x, y, ctx)) {
                                                                       ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘std::string utils::EccSm2::Sign(const string&, const string&)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:473:74: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
      if (!EC_POINT_get_affine_coordinates_GF2m(group_, pt1, x1, NULL, ctx)) {
                                                                          ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In static member function ‘static int utils::EccSm2::verify(EC_GROUP*, const string&, const string&, const string&, const string&)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:586:69: error: ‘EC_POINT_set_affine_coordinates_GF2m’ was not declared in this scope
    EC_POINT_set_affine_coordinates_GF2m(group, pub_key, xp, yp, NULL);
                                                                     ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:643:73: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
    if (!EC_POINT_get_affine_coordinates_GF2m(group, point, x1, NULL, ctx)) {
                                                                         ^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘std::string utils::EccSm2::GetPublicKey()’:
/
Sep 17, 2018 in Blockchain by slayer
• 29,370 points
1,261 views

1 answer to this question.

0 votes

Step 1: I assume that your present working directory is the Ruby source directory.

Step 2: Download the patch as shown below:

# wget https://bugs.ruby-lang.org/attachments/download/3707/out.patch

# ls out.patch
out.patch

# find . -name ossl_pkey_ec.c
./ext/openssl/ossl_pkey_ec.c

Step 4: Run the downloaded patch

# patch ./ext/openssl/ossl_pkey_ec.c < out.patch
patching file ./ext/openssl/ossl_pkey_ec.c
Hunk #1 succeeded at 757 (offset -5 lines).
Hunk #2 succeeded at 814 (offset -5 lines).
patching file ./ext/openssl/ossl_pkey_ec.c
Hunk #1 FAILED at 7.
1 out of 1 hunk FAILED -- saving rejects to file ./ext/openssl/ossl_pkey_ec.c.rej

This should work.

answered Sep 17, 2018 by digger
• 26,740 points

Related Questions In Blockchain

+1 vote
5 answers

How to solve "truffle: command not found" error in blockchain?

First try restarting the system and then ...READ MORE

answered Jul 16, 2018 in Blockchain by slayer
• 29,370 points
12,016 views
0 votes
1 answer

Error in Chaincodes not getting picked up by ./startFabric.sh

After changing chaincode in fabric-samples/chaincode/fabcar/go/fabcar.go (this is ...READ MORE

answered Jul 31, 2018 in Blockchain by Shashank
• 10,400 points
1,277 views
0 votes
1 answer

Error using EtherJS: this.provider.getTransactionCount is not a function

With this line it should work fine: wallet.provider ...READ MORE

answered Sep 26, 2018 in Blockchain by digger
• 26,740 points
2,573 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,740 points
45,301 views
0 votes
1 answer

How do I add multiple recipients for transactions via Blockchain API?

Convert the recipes into JSON objects. x = ...READ MORE

answered Jul 6, 2018 in Blockchain by Perry
• 17,100 points
930 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,947 views
0 votes
0 answers

Blockchain.info wallet API callback

I am implementing blockchain.info wallet api to ...READ MORE

Jul 4, 2018 in Blockchain by sabby
• 4,370 points
905 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP