Carmageddon
Carmageddon

Reputation: 2849

C++ Linking cant find library on project migration from Unix to Linux

After resolving all compilation errors due to migration, now there are Linker errors for libraries.

Original output is as follows (some names in project were replaced for obvious reasons):

----------------------------------------------------------------
 (G) Linking module_name.o to make module_name
     LDOPTS set to:
  SHLIB Temp Path: /tmp/fbaSHLIBs020217035348fbamgr
     FBA libraries: -L/tmp/fbaSHLIBs020217035348fbamgr -lfba -lprocessControl
     Application libraries: -L/opt/app/fba/devl_rel_ver/bin/lib -lfba -lprojNameGenEdit -lprojNameTraceTool -lprojNameTables -lprojNameCommCcSc -lprojNamerecProc -lprojNameGenMap -lprojNameLogicalTracker -lprojNameCallCodes -lprojNameStrCodes -lprojNameFileVal -lprojNameReports -L -ltmi -L/opt/IBM/db2/V8.1/lib64  -ldb2
g++ -o module_name module_name.o \
                 \
                -I/opt/app/fba/devl_rel_ver/common \
                -L/tmp/fbaSHLIBs020217035348fbamgr -lfba -lprocessControl  \
                -L/opt/app/oraclnt/oracle/product/11.2.0.3/lib -lclntsh \
                `cat /opt/app/oraclnt/oracle/product/oraclient/lib/ldflags`  \
                `cat /opt/app/oraclnt/oracle/product/oraclient/lib/sysliblist` \
                -L/opt/app/fba/devl_rel_ver/bin/lib -lfba -lprojNameGenEdit -lprojNameTraceTool -lprojNameTables -lprojNameCommCcSc -lprojNamerecProc -lprojNameGenMap -lprojNameLogicalTracker -lprojNameCallCodes -lprojNameStrCodes -lprojNameFileVal -lprojNameReports -L$TMI_HOME -ltmi -L/opt/IBM/db2/V8.1/lib64  -ldb2
/usr/bin/ld: cannot find -lfba
collect2: ld returned 1 exit status
make: *** [module_name] Error 1

The files in the temp folder (also, with above name replacement done):

ls /tmp/fbaSHLIBs020217035348fbamgr
libfba.sl             libprojNameCallCodes.sl  libprojNameFileVal.sl  libprojNameGenMap.sl          libprojNamerecProc.sl  libprojNameStrCodes.sl  libprojNameTraceTool.sl
libprocessControl.sl  libprojNameCommCcSc.sl   libprojNameGenEdit.sl  libprojNameLogicalTracker.sl  libprojNameReports.sl  libprojNameTables.sl

What I tried:

  1. FBALIB = -L$(TEMP_SHLIB_DIR) $(TEMP_SHLIB_DIR)/libfba.sl $(TEMP_SHLIB_DIR)/libprocessControl.sl
  2. List itemFBALIB = -L$(TEMP_SHLIB_DIR) -llibfba.sl -llibprocessControl.sl
  3. FBALIB = -L$(TEMP_SHLIB_DIR) -l$(TEMP_SHLIB_DIR)/libfba.sl -lprocessControl

Nothing works!

Please, any ideas what am I missing?

Upvotes: 0

Views: 72

Answers (1)

Dr. Snoopy
Dr. Snoopy

Reputation: 56397

Seems .sl files are HP-UX shared libraries, while linux uses the .so extension for shared libraries. Seems you copied the HP-UX libraries to Linux, and this is not going to work.

The only solution is to get equivalent library files for Linux, with the proper .so extension.

Upvotes: 1

Related Questions