It almost works, I think :) It's just a linking problem - hopefully someone here has seen it before and can tell me how to resolve it (or at least point me in the direction I need to go.)
Here are the erros on linking:
g++ -fpermissive -Wall -O2 -o build/maildemo objs/mail.o objs/mailer.o -lnls -lsocket
Undefined first referenced
symbol in file
gethostbyname objs/mailer.o (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
gethostbyaddr objs/mailer.o (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
inet_aton objs/mailer.o
ld: fatal: Symbol referencing errors. No output written to build/maildemo
Oh, one quick note: I had to change all the _[A-Z] (and those like them) enums in base64.h to be B64_[A-Z] since on Solaris it appears as if there are already some of those defined (for example, _B and _C) -.
I hope we can get this linking issue resolved - this class is the perfect answer to a problem I have.
Thanks for a nice piece of software that will get used on other projects as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did you try just using the Makefile directly.
i.e. just type (in the unpacked codes directory):
"make mail"
on the command line rather than
g++ -fpermissive -Wall -O2 -o build/maildemo objs/mail.o objs/mailer.o -lnls -lsocket
'g++' will then be called thus, minus the '-l' calls:
g++ -Wall -c mailer.cpp -o objs/mailer.o
g++ -Wall -c mail.cpp -o objs/mail.o
g++ -o build/maildemo objs/mail.o objs/mailer.o
Let me know what errors you get at this point.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Back to the drawing board. The problem here is that I do not have a SunOS powered machine to understand its compiling quirks! Did you do a make clean before trying again, silly question sorry. Just in case it works. As I say I tested on linux and win98/XP I am stumped at present.
Have you tried reversing -lnsl -lsocket i.e.
-lsocket -lnsl
sounds stoopid but hey!!!
check this: http://mail.rdesktop.org/archive/2002/msg00238.html
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It turns out that if you link nsl instead of nls it will work much better. I'm usually pretty good as a proofreader, but this one took *much* too long to find.
sigh.
Thanks for your help and input. I can now report that as long as you add -lsocket -lresolv -lnsl to the link statements that this class will compile and link under SunOS-i386 and SunOS-sparc (version 8 in both cases, although I don't think that matters.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It almost works, I think :) It's just a linking problem - hopefully someone here has seen it before and can tell me how to resolve it (or at least point me in the direction I need to go.)
Here are the erros on linking:
g++ -fpermissive -Wall -O2 -o build/maildemo objs/mail.o objs/mailer.o -lnls -lsocket
Undefined first referenced
symbol in file
gethostbyname objs/mailer.o (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
gethostbyaddr objs/mailer.o (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
inet_aton objs/mailer.o
ld: fatal: Symbol referencing errors. No output written to build/maildemo
Oh, one quick note: I had to change all the _[A-Z] (and those like them) enums in base64.h to be B64_[A-Z] since on Solaris it appears as if there are already some of those defined (for example, _B and _C) -.
I hope we can get this linking issue resolved - this class is the perfect answer to a problem I have.
Thanks for a nice piece of software that will get used on other projects as well.
Did you try just using the Makefile directly.
i.e. just type (in the unpacked codes directory):
"make mail"
on the command line rather than
g++ -fpermissive -Wall -O2 -o build/maildemo objs/mail.o objs/mailer.o -lnls -lsocket
'g++' will then be called thus, minus the '-l' calls:
g++ -Wall -c mailer.cpp -o objs/mailer.o
g++ -Wall -c mail.cpp -o objs/mail.o
g++ -o build/maildemo objs/mail.o objs/mailer.o
Let me know what errors you get at this point.
No, I added the -l calls to the makefile as this is what normally resolves the gethost entries.
and -fpermissive was added on advice from someone else, but it didnt' help.
With or without the flags I get the same response. I did add -lresolv and that fixed the inet_aton problem.
(I apologize for adding this thread again - an unfortunate side effect of me hitting refresh to see if there had been a reply to my message)
Back to the drawing board. The problem here is that I do not have a SunOS powered machine to understand its compiling quirks! Did you do a make clean before trying again, silly question sorry. Just in case it works. As I say I tested on linux and win98/XP I am stumped at present.
Have you tried reversing -lnsl -lsocket i.e.
-lsocket -lnsl
sounds stoopid but hey!!!
check this:
http://mail.rdesktop.org/archive/2002/msg00238.html
ok, who's the smart aleck here!?
It turns out that if you link nsl instead of nls it will work much better. I'm usually pretty good as a proofreader, but this one took *much* too long to find.
sigh.
Thanks for your help and input. I can now report that as long as you add -lsocket -lresolv -lnsl to the link statements that this class will compile and link under SunOS-i386 and SunOS-sparc (version 8 in both cases, although I don't think that matters.)
Excellent, maybe i'll change the Makefile to reflect this.