Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

Build from sources: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive] #1

Description

@cobraalloc
sendReceiver.cpp:136:51: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]    

BIO* cbio = BIO_new_mem_buf(mypem, sizeof(mypem));

/usr/include/openssl/bio.h:668:6: error:   initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’ [-fpermissive]
 BIO *BIO_new_mem_buf(void *buf, int len);
FULL ERROR LOG

Scanning dependencies of target anonfile
[ 20%] Building CXX object CMakeFiles/anonfile.dir/helpers/helpers.cpp.o
[ 40%] Building CXX object CMakeFiles/anonfile.dir/sendReceiver/sendReceiver.cpp.o
[ 60%] Building CXX object CMakeFiles/anonfile.dir/json_handler/JHandler.cpp.o
[ 80%] Building CXX object CMakeFiles/anonfile.dir/main.cpp.o
/home/travis/build/0x000N3X4N/anonfile/helpers/helpers.cpp: In static member function ‘static std::string Helpers::readFromFile(std::ifstream&)’:
/home/travis/build/0x000N3X4N/anonfile/helpers/helpers.cpp:35:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::basic_string<char>::size_type {aka long unsigned int}’ [-Wformat=]
     printf("Size of input file: %d\n", tmp.size());
                                                  ^
/home/travis/build/0x000N3X4N/anonfile/sendReceiver/sendReceiver.cpp: In static member function ‘static CURLcode SendReceiver::sslctx_function(CURL*, void*, void*)’:
/home/travis/build/0x000N3X4N/anonfile/sendReceiver/sendReceiver.cpp:136:51: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
   BIO* cbio = BIO_new_mem_buf(mypem, sizeof(mypem));
                                                   ^
In file included from /usr/include/openssl/ssl.h:152:0,
                 from /home/travis/build/0x000N3X4N/anonfile/sendReceiver/sendReceiver.h:10,
                 from /home/travis/build/0x000N3X4N/anonfile/sendReceiver/sendReceiver.cpp:1:
/usr/include/openssl/bio.h:668:6: error:   initializing argument 1 of ‘BIO* BIO_new_mem_buf(void*, int)’ [-fpermissive]
 BIO *BIO_new_mem_buf(void *buf, int len);
      ^
make[2]: *** [CMakeFiles/anonfile.dir/sendReceiver/sendReceiver.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/anonfile.dir/all] Error 2
make: *** [all] Error 2
The command "make -j4" exited with 2.

For resolve this issue you need to install openssl version greater than OpenSSL 1.0.1f 6 Jan 2014 or open the file named sendReceiver.cpp and jump to line 113 static const char mypem[] = and delete const modifier, after the changes the line should look like static char mypem[] =.
Save and rebuild.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions