- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: linking error : "Unsatisfied symbol ..."
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2014 04:54 AM - last edited on 10-30-2014 06:53 PM by Lisa198503
10-30-2014 04:54 AM - last edited on 10-30-2014 06:53 PM by Lisa198503
linking error : "Unsatisfied symbol ..."
Hi
I encountered linking error while compiling my simple code in HP-UX (B.11.23)
error :
$ gcc -g -Wall -I/usr/local/ssl/include/openssl -c my_sha.cpp
$ gcc -o MY_SHA my_sha.o -lstdc++ -L/usr/local/ssl/lib -lcrypto
ld: Unsatisfied symbol "SHA512" in file my_sha.o
1 errors.
collect2: ld returned 1 exit status
i checked crypto library by 'nm' command, it seems that the library has SHA512 function.
nm :
$ nm /usr/local/ssl/lib/libcrypto.a | grep SHA512
0000000000000010 T SHA512
0000000000000010 T SHA512_Final
0000000000000000 T SHA512_Init
0000000000000000 T SHA512_Transform
0000000000000000 T SHA512_Update
0000000000000000 R SHA512_version
U SHA512_Final
U SHA512_Init
U SHA512_Update
in other system (Linux), this code can be complied successfully.
but I tried in HP-UX, I can't ...
Is there any reason I can't know ?
I'm hoping for anyone's any advice .. :)
my code :
#include <openssl/evp.h>
#include <string.h>
#include <string>
#include "sha.h"
using namespace std;
string base64_encodestring(int nLen, char *pData)
{
EVP_ENCODE_CTX ectx;
int outlen = 0, tlen = 0;
int size = nLen + 34;
unsigned char* out = (unsigned char*)malloc(size);
EVP_EncodeInit(&ectx);
EVP_EncodeUpdate(&ectx, out, &outlen, (const unsigned char *)pData, nLen);
tlen += outlen;
EVP_EncodeFinal(&ectx, out+tlen, &outlen);
tlen += outlen;
out[tlen] = '\0';
string str = (char*)out;
free(out);
return str;
}
int main(int arc, char **argv)
{
char strPinORG[16], strPinSSL[256];
memset(strPinORG, 0x00, sizeof(strPinORG));
memset(strPinSSL, 0x00, sizeof(strPinSSL));
strncpy(strPinORG, argv[0], 15);
//sha-512 (strPinORG --> strPinSSL)
SHA512((unsigned char *)strPinORG, strlen(strPinORG), (unsigned char *)strPinSSL);
//encode (strPinSSL --> strPinNo)
string strPinNo = base64_encodestring(64, strPinSSL);
//printf("strPinNo=[%s]\n", strPinNo);
return EXIT_SUCCESS;
}
P.S. This thread has been moved from HP-UX>General to HP-UX > languages. -HP Forum Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2014 08:31 AM - edited 10-30-2014 08:33 AM
10-30-2014 08:31 AM - edited 10-30-2014 08:33 AM
Re: linking error : "Unsatisfied symbol ..."
$ gcc ... -lstdc++ -L/usr/local/ssl/lib -lcrypto
$ nm /usr/local/ssl/lib/libcrypto.a | grep SHA512
0000000000000010 T SHA512
It looks like your system has illegally placed a 64 bit lib in a lib/ directory instead of the standard lib/hpux64/.
You need to get a 32 bit version of that lib and change that -L, or build with 64 bit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2014 12:27 PM
10-30-2014 12:27 PM
Re: linking error : "Unsatisfied symbol ..."
@Dennis Handly wrote:...
It looks like your system has illegally placed a 64 bit lib in a lib/ directory instead of the standard lib/hpux64/.
You need to get a 32 bit version of that lib and change that -L, or build with 64 bit.
hi Dennis.
thanks for reply :)
first of all, I want to compile my code with 64 bit.
and I have to use openssl lib for SHA512.
as you said, the lib is not in /usr/lib/hpux64.
the standard lib - libcrypto.a - in /usr/lib/hpux64 is not support SHA512.
so I downloaded openssl from openssl official site, and I compiled and install it.
as a result, it's lib file installed in the path (/usr/local/ssl/lib).
so I tried to re-install again (with 64 bit), but the error occured again..
$ gcc -g -Wall -I/usr/local/ssl/include/openssl -c my_sha.cpp $ gcc -o MY_SHA my_sha.o -lstdc++ -L/usr/local/ssl/lib -lcrypto ld: Unsatisfied symbol "SHA512" in file my_sha.o 1 errors. collect2: ld returned 1 exit status
and I confirmed library again..
$ nm /usr/local/ssl/lib/libcrypto.a | grep SHA512 0000000000000980 T SHA512 0000000000000200 T SHA512_Final 0000000000000100 T SHA512_Init 00000000000007a0 T SHA512_Transform 0000000000000510 T SHA512_Update 0000000000000000 R SHA512_version U SHA512_Final U SHA512_Init U SHA512_Update
give me advice please..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2014 06:21 AM
10-31-2014 06:21 AM
Re: linking error : "Unsatisfied symbol ..."
>I want to compile my code with 64 bit.
Since the default is 32 bit, you need to add an option for both compiling and linking, something like: -mlp64
>the lib is not in /usr/lib/hpux64.
It doesn't have to be in /usr/lib, but it has to be in .../lib/hpux??/.