none
C++ project in Visual Studio 2015 for Linux with Openssl RRS feed

  • Question

  • Hi all

    I'm trying to compile a project for raspberry pi 3 in Visual Studio 2015 with the includes <openssl / ssl.h> and "openssl / err.h" without success.

    This program, depending on the outcome of a given task, should send an email using gmail.

    This same program for Windows works well.

    But when I tried to compile for rasbpberry pi 3 using visualGDB I got the following errors:
    Undefined reference to `SSL_read '
    Error: undefined reference to `SSL_get_error '
    Error: undefined reference to `SSL_pending '
    Undefined reference to `SSL_write '
    Error: undefined reference to `SSL_connect '.


    Anyway, for all the openssl functions used in the project I get the same type of error.


    Can you help me with this problem?
    I will be immensely happy and grateful!

    • Moved by 宝宝徐 Tuesday, August 29, 2017 6:08 AM
    Wednesday, August 2, 2017 11:54 PM

All replies

  • Hi friend,

    Thanks for your posting.

    After you install (normal ordinary installation) openssl.

    Make sure the following settings are setup in the project property pages:

    [C/C++ -> General -> Additional Include Directories] value: OpenSSL’s include directory in your machine (e.g C:\openssl\include)

    [Linker -> General -> Additional Library Directories] value: OpenSSL’s lib directory in your machine (e.g C:\openssl\lib)

    [Linker -> Input -> Additional Dependencies] value: libeay32.lib

    Reference

      

    Best regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Thursday, August 3, 2017 7:24 AM
    Thursday, August 3, 2017 7:24 AM
  • Hi Fletcher

    Thank you for your answer. I do it and when I compile I get following errors:

    Linking objects
    1>         Invoking ld
    1>         g++ -pthread   -o "/home/pi/projects/RaspEmail/bin/ARM/Debug/RaspEmail.out" -Wl,--no-undefined -Wl,-L"C:\OpenSSL-Win64\lib" -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack /home/pi/projects/RaspEmail/obj/ARM/Debug/base64.o /home/pi/projects/RaspEmail/obj/ARM/Debug/DateAndFaultDescription.o /home/pi/projects/RaspEmail/obj/ARM/Debug/main.o /home/pi/projects/RaspEmail/obj/ARM/Debug/md5.o /home/pi/projects/RaspEmail/obj/ARM/Debug/Smtp.o /home/pi/projects/RaspEmail/obj/ARM/Debug/Troubleshooting.o libeay32.lib
    1>         g++: error: libeay32.lib: No such file or directory
    1>         g++: error: libeay32.lib: No such file or directory

    Thursday, August 3, 2017 3:44 PM
  • Hi friend,

    Thanks for your reply.

    >>  g++: error: libeay32.lib: No such file or directory

    "To address this issue, you may copy LIBEAY.DLL, which you can found it in the OpenSSL bin folder, to the project’s debug/release folder"

     

    Btw, VisualGDB official forum might offer professional help.

     

    Best regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.




    Friday, August 4, 2017 5:40 AM