Home Help Center

Linking problem in Linux

amrufonamrufon Member AlexOrganization: ISTProject: jDatabase ✭✭
Hi.

I'm using Ice 1.1.1 on a Mandrake Linux 9.1. I was able to compile successfully and it was installed in /opt/Ice-1.1.1. I also modified my /etc/ld.config.so to have the entry /opt/Ice-1.1.1/lib and then run ldconfig as superuser. Running ldd on slice2cpp also shows that the shared objects are not missing and are accessible.

My problem is that linking an application that uses the Ice library fails. For example, I haven't been able to link the Hello World application. Linking will always return:
/usr//bin/ld: cannot find -lIce.so

I've already tried the following:
$ gcc main.o printer.o -lIce.so -o icehelloserver
$ gcc main.o printer.o -llibIce.so -o icehelloserver
$ gcc main.o printer.o -L/opt/Ice-1.1.1/lib -lIce.so -o icehelloserver
$ gcc main.o printer.o -L/opt/Ice-1.1.1/lib -llibIce.so -o icehelloserver

Any ideas?

Thanks.

Alex

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Alex,

    Try this one, it should work better:
    g++ main.o printer.o -L/opt/Ice-1.1.1/lib -lIce -lIceUtil -lpthread -o icehelloserver
    

    Benoit.
  • amrufonamrufon Member AlexOrganization: ISTProject: jDatabase ✭✭
    Hey Benoit!

    Thanks a lot! It worked. :D

    Alex
Sign In or Register to comment.