Operating System - Linux
1752795 Members
6217 Online
108789 Solutions
New Discussion юеВ

usr/ccs/bin/ld: Unsatisfied symbols

 
msbinu
Advisor

usr/ccs/bin/ld: Unsatisfied symbols

Hi all ,
I have 3 files like below

md5.c
{
MDString(char *){}
}
md5.h{MDString(char*)}

ssl.cxx
{
#include

MDString(char*);
}
When I try to compile this I m getting the following error


/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (ssl.o) was detected. The linked output may not run on a PA 1.x system.
/usr/ccs/bin/ld: Unsatisfied symbols:
MDString(char *) (code)1

I m using the following command to compile my code

aCC -lcma -I/home/mydir/openssl-0.9.8a/include ssl.cxx md5.c -L . -lssl -lcrypto -o binu

can any one help me

Thanks a lot in advance
Binu
3 REPLIES 3
H.Merijn Brand (procura
Honored Contributor

Re: usr/ccs/bin/ld: Unsatisfied symbols

--8<--- md5.c
void MDString (char *s)
{
return;
} /* MDString */
-->8---

--8<--- md5.h
extern void MDString (char*);
-->8---

--8<--- ssl.cxx
{
#include

MDString(char*);
}
-->8---

I have NO idea how c++ works, so I do not know how that ssl.cxx should look like

But that C source should be compiled first to make it a loadable object, I think

# cc -c -o md5.c

then you might be able to load it in with your c++ file

# aCC -lcma -I/home/mydir/openssl-0.9.8a/include ssl.cxx md5.o -Wl,+vnocompatwarnings -L . -lssl -lcrypto -o binu

the -Wl,+vnocompatwarnings is to preven that annoying compatability warning

I hope this helps. If not, wait for some c++ guru's

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Dennis Handly
Acclaimed Contributor

Re: usr/ccs/bin/ld: Unsatisfied symbols

>I have 3 files like below
md5.c
{
MDString(char *){}
}

Do you actually have a file with a {} block in it?

>ld: Unsatisfied symbols:
MDString(char *) (code)

This indicates you have a mangled name for the unsat. But MDString is C?

Your needs to be C++ified. It should have lines like:
#ifdef __cplusplus
extern "C" {
#endif
...
MDString(char *){}
#ifdef __cplusplus
}
#endif

>I'm using the following command to compile my code:
aCC -lcma -I/home/mydir/openssl-0.9.8a/include ssl.cxx md5.c -L . -lssl -lcrypto -o binu

If you are using aCC to compile md5.c, it should be C++ so you can't get this unsat.

There are several other issues. Why are you using -lcma? You should be using kernel threads and compile with +mt.

Also libs should go at the end of the line.
msbinu
Advisor

Re: usr/ccs/bin/ld: Unsatisfied symbols

Hi All ,

My problem is resolved .
I was trying to access a static function from a different file ...