Home > Back-end >  C link problem
C link problem

Time:09-17

Using cmake building engineering
A compile-time error:
CMakeFiles/EmailAlarm. Dir/SSLEmail. CPP. O: in function 'SslSmtpEmail: : Connect () :'
SSLEmail. CPP: (. Text + 0 x2b5e) : 'OPENSSL_init_ssl undefined reference to'
SSLEmail. CPP: (. Text + 0 x2b6d) : 'OPENSSL_init_crypto undefined reference to'
SSLEmail. CPP: (. Text + 0 x2b7c) : 'OPENSSL_init_ssl undefined reference to'
SSLEmail. CPP: (. Text + 0 x2b81) : 'TLS_client_method undefined reference to'
Collect2: error: ld return 1

View the cmake generated link. TXT file for:
/usr/local/bin/c + + - m64 - STD=c + + 17 - pthread - LDL - rdynamic CMakeFiles/EmailAlarm dir/EmailAlarm CPP. O CMakeFiles/EmailAlarm dir/SSLEmail CPP. O CMakeFiles/EmailAlarm dir/main CPP. O - o EmailAlarm - L/home/bettercomm/local/lib - Wl - rpath,/home/bettercomm/local/lib:/home/bettercomm/local/lib/common. A - Wl, - Bstatic - luuid - Wl - Bdynamic - LSSL - lcrypto

Out is the same as the manual link error, but the CMakeFiles/EmailAlarm dir/SSLEmail CPP. O directly into a specified path of the CPP file can link success,

Has anyone encountered this problem?

CodePudding user response:

Problem has been solved, should be the version of openssl problem, as to why the CPP links to succeed, is unclear,
  • Related