Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  demo/c++ link failure

    Posted 10/12/22 04:54 PM
    Hi All,

    I am working on HP-UX 9000/800 platform.

    I am trying to compile the demo source code provided with the Informix 14.10 client. (informixConnect_1410/demo/c++/)

    I modified the make file in order to use gcc and c++ compilers rather than cc and aCC.

    Unfortunately, any demo program ends with a linking error.

    Is someone have an idea why the linker doesn't find the symbol embedded in libifc++.a library?

    Many thanks for any help by advance.

    For instance:
    > make tabcnt

    > /gccinstall/gcc/local/bin/c++ -g -Wall -Wextra -pthread -O0 -isystem/gccinstall/gcc/local/include -ext -D__STDCPP__ -D_PROTOTYPES -DMITRACE_OFF -DIT_HAS_DISTINCT_LONG_DOUBLE -DIT_COMPILER_HAS_LONG_LONG -I/informixConnect_1410/inc -I/informixConnect_1410/incl/public -I/informixConnect_1410/incl/c++ -I/informixConnect_1410/incl/dmi -I/informixConnect_1410/incl/esql -c tabcnt.cpp

    > /gccinstall/local/bin/c++ -o tabcnt tabcnt.o -L/informixConnect_1410/lib/c++ -lifc++ -L/informixConnect_1410/lib/dmi -lifdmi -L/informixConnect_1410/lib/esql -L/informixConnect_1410/lib -lifsql -lifasf -lifgen -lifos -lifgls -lifglx /informixConnect_1410/lib/esql/checkapi.o -lm -lV3 -lcl -lsec -lnsl_s -lc -ldld

    /usr/ccs/bin/ld: Unsatisfied symbols:
    ITQuery::ExecOneRow(ITString const&, ITEssential**)(first referenced in tabcnt.o) (code)
    ITQuery::~ITQuery()(first referenced in tabcnt.o) (code)
    ITConnection::~ITConnection()(first referenced in tabcnt.o) (code)
    ITQuery::ITQuery(ITConnection const&)(first referenced in tabcnt.o) (code)
    ITConnection::Open() (first referenced in tabcnt.o) (code)
    ITString::~ITString()(first referenced in tabcnt.o) (code)
    ITConnection::ITConnection()(first referenced in tabcnt.o) (code)
    ITString::ITString(char const*)(first referenced in tabcnt.o) (code)
    collect2: ld returned 1 exit status
    *** Error exit code 1


    My makefile is now like this:
    #Makefile related...
    CPPIFDIR = $(INFORMIXDIR)
    RANLIB = echo
    RM = rm -f
    #Compiler and linker related...
    GCC_DIR=${GCC_HOME}
    CC = $(GCC_DIR)/bin/c++
    CCHOME = $(GCC_DIR)
    CCPP = $(GCC_DIR)/bin/c++
    CCPLUS = $(CCPP) $(HEADEROPTS)
    CCPPFLAGS = -g -Wall -Wextra -pthread -O0 -isystem$(GCC_DIR)/include -ext $(CCDEFS)
    CCDEFS = -D__STDCPP__ -D_PROTOTYPES \
    -DMITRACE_OFF -DIT_HAS_DISTINCT_LONG_DOUBLE \
    -DIT_COMPILER_HAS_LONG_LONG
    ESQL = $(INFORMIXDIR)/bin/esql
    CCPLINK = $(CCPLUS)
    #Includes...
    INCL_ESQL = -I$(INFORMIXDIR)/incl/esql
    INCL_LIBMI = -I$(INFORMIXDIR)/incl/dmi
    INCL_CPPIF = -I$(INFORMIXDIR)/incl/c++
    INCL = -I$(INFORMIXDIR)/incl -I$(INFORMIXDIR)/incl/public \
    $(INCL_CPPIF) $(INCL_LIBMI) $(INCL_ESQL)
    #Libraries...
    LIBS_SYSTEM = -lm -lV3 -lcl -lsec -lnsl_s -lc -ldld
    LIBS_ESQL = -L$(INFORMIXDIR)/lib/esql -L$(INFORMIXDIR)/lib -lifsql -lifasf -lifgen -lifos -lifgls -lifglx $(INFORMIXDIR)/lib/esql/checkapi.o
    LIBS_LIBMI = -L$(INFORMIXDIR)/lib/dmi -lifdmi
    LIBS_CPPIF = -L$(INFORMIXDIR)/lib/c++ -lifc++
    LIBS = $(LIBS_CPPIF) $(LIBS_LIBMI) $(LIBS_ESQL) $(LIBS_SYSTEM)


    ------------------------------
    Stephane GONZALEz
    ------------------------------

    #Informix


  • 2.  RE: demo/c++ link failure

    Posted 10/13/22 05:04 AM

    Hi Stephane,

    Have you thought about setting the environment variable LIBPATH or LD_LIBRARY_PATH before running the make command?

    LIBPATH or LD_LIBRARY_PATH tells the make command which directories to search for dynamic link libraries.

    In your LIBPATH or LD_LIBRARY_PATH, you must add the Informix dynamic libraries directories (as $INFORMIXDIR/lib, $INFORMIXDIR/lib/esql and $INFORMIXDIR/lib/tools) and all the Unix libraries directories (as /lib, /usr/lib ...).

    Regards,

    -- Franck Thomas ConsultiX franck.thomas@consult-ix.fr http://www.consult-ix.fr Téléphone : 33 (0) 1 39 12 18 00 Mobile    : 33 (0) 6 78 81 09 33 Fax       : 33 (0) 1 39 12 18 18
    Le 12/10/2022 à 22:54, Stephane GONZALEz via IBM Community a écrit :
    01000183cdf9c36d-1d474d18-0d27-449f-8409-d078a1b0d336-000000@email.amazonses.com">
    Hi All, I am working on HP-UX 9000/800 platform. I am trying to compile the demo source code provided with the Informix 14.10 client. ... -posted to the "Informix" group
    IBM Community

    Informix

    Post New Message
    demo/c++ link failure
    Reply to Group Reply to Sender
    Stephane GONZALEz
    Oct 12, 2022 4:54 PM
    Stephane GONZALEz
    Hi All,

    I am working on HP-UX 9000/800 platform.

    I am trying to compile the demo source code provided with the Informix 14.10 client. (informixConnect_1410/demo/c++/)

    I modified the make file in order to use gcc and c++ compilers rather than cc and aCC.

    Unfortunately, any demo program ends with a linking error.

    Is someone have an idea why the linker doesn't find the symbol embedded in libifc++.a library?

    Many thanks for any help by advance.

    For instance:
    > make tabcnt

    > /gccinstall/gcc/local/bin/c++ -g -Wall -Wextra -pthread -O0 -isystem/gccinstall/gcc/local/include -ext -D__STDCPP__ -D_PROTOTYPES -DMITRACE_OFF -DIT_HAS_DISTINCT_LONG_DOUBLE -DIT_COMPILER_HAS_LONG_LONG -I/informixConnect_1410/inc -I/informixConnect_1410/incl/public -I/informixConnect_1410/incl/c++ -I/informixConnect_1410/incl/dmi -I/informixConnect_1410/incl/esql -c tabcnt.cpp

    > /gccinstall/local/bin/c++ -o tabcnt tabcnt.o -L/informixConnect_1410/lib/c++ -lifc++ -L/informixConnect_1410/lib/dmi -lifdmi -L/informixConnect_1410/lib/esql -L/informixConnect_1410/lib -lifsql -lifasf -lifgen -lifos -lifgls -lifglx /informixConnect_1410/lib/esql/checkapi.o -lm -lV3 -lcl -lsec -lnsl_s -lc -ldld

    /usr/ccs/bin/ld: Unsatisfied symbols:
    ITQuery::ExecOneRow(ITString const&, ITEssential**)(first referenced in tabcnt.o) (code)
    ITQuery::~ITQuery()(first referenced in tabcnt.o) (code)
    ITConnection::~ITConnection()(first referenced in tabcnt.o) (code)
    ITQuery::ITQuery(ITConnection const&)(first referenced in tabcnt.o) (code)
    ITConnection::Open() (first referenced in tabcnt.o) (code)
    ITString::~ITString()(first referenced in tabcnt.o) (code)
    ITConnection::ITConnection()(first referenced in tabcnt.o) (code)
    ITString::ITString(char const*)(first referenced in tabcnt.o) (code)
    collect2: ld returned 1 exit status
    *** Error exit code 1


    My makefile is now like this:
    related...
    CPPIFDIR = $(INFORMIXDIR)
    RANLIB = echo
    RM = rm -f
    #Compiler and linker related...
    GCC_DIR=${GCC_HOME}
    CC = $(GCC_DIR)/bin/c++
    CCHOME = $(GCC_DIR)
    CCPP = $(GCC_DIR)/bin/c++
    CCPLUS = $(CCPP) $(HEADEROPTS)
    CCPPFLAGS = -g -Wall -Wextra -pthread -O0 -isystem$(GCC_DIR)/include -ext $(CCDEFS)
    CCDEFS = -D__STDCPP__ -D_PROTOTYPES \
    -DMITRACE_OFF -DIT_HAS_DISTINCT_LONG_DOUBLE \
    -DIT_COMPILER_HAS_LONG_LONG
    ESQL = $(INFORMIXDIR)/bin/esql
    CCPLINK = $(CCPLUS)
    ...
    INCL_ESQL = -I$(INFORMIXDIR)/incl/esql
    INCL_LIBMI = -I$(INFORMIXDIR)/incl/dmi
    INCL_CPPIF = -I$(INFORMIXDIR)/incl/c++
    INCL = -I$(INFORMIXDIR)/incl -I$(INFORMIXDIR)/incl/public \
    $(INCL_CPPIF) $(INCL_LIBMI) $(INCL_ESQL)
    ...
    LIBS_SYSTEM = -lm -lV3 -lcl -lsec -lnsl_s -lc -ldld
    LIBS_ESQL = -L$(INFORMIXDIR)/lib/esql -L$(INFORMIXDIR)/lib -lifsql -lifasf -lifgen -lifos -lifgls -lifglx $(INFORMIXDIR)/lib/esql/checkapi.o
    LIBS_LIBMI = -L$(INFORMIXDIR)/lib/dmi -lifdmi
    LIBS_CPPIF = -L$(INFORMIXDIR)/lib/c++ -lifc++
    LIBS = $(LIBS_CPPIF) $(LIBS_LIBMI) $(LIBS_ESQL) $(LIBS_SYSTEM)


    ------------------------------
    Stephane GONZALEz
    ------------------------------
      Reply to Group Online   View Thread   Recommend   Forward  



     
    You are subscribed to "Informix" as franck.thomas@consult-ix.fr. To change your subscriptions, go to My Subscriptions. To unsubscribe from this community discussion, go to Unsubscribe.





  • 3.  RE: demo/c++ link failure

    Posted 10/13/22 10:17 AM
    Are we talking about this:  "The HP 9000 800 Nova servers were second-generation 32-bit HP PA-RISC servers from the early 1990s and based on PA-7000 and PA-7100 processors." ?

    And in relation to Informix version 14.10 (or corresponding client sdk 4.50)?

    I don't know that either server version 14.10 or client version 4.50 had been built and provided for HP-UX on PA-RISC (rather than Itanium), so you might simply be looking at a software compatibility problem.
    I don't even recall the last version that had been provided for HP-UX on PA-RISC.

    Let's hope I'm on a totally wrong track here ;-)

    ------------------------------
    Andreas Legner
    ------------------------------



  • 4.  RE: demo/c++ link failure

    Posted 10/13/22 10:45 AM
    Hi,
    Yes, I am talking about this kind of computer. (We are on the cutting edge of technology :))

    So, actually the version of the sdk is 3.70 for HPUX PA-RISK. (But it has been renamed by a teammate informixConnect_1410)

    However, the link still does not work.
    I also tried to add the libraries path in LD_LIBRARY_PATH and LIBPATH as suggested by @Franck THOMAS




    ------------------------------
    Stephane GONZALEZ
    ------------------------------