helpMySQL++ - Support: sr #2667, Linking of 'lib' fails with...

 
 
Show feedback again

sr #2667: Linking of 'lib' fails with SunStudio 12 compiler

Submitted by:  Arjan Hulsbosch <ahulsbos>
Submitted on:  Tue 14 Dec 2010 05:13:14 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 14 Dec 2010 05:13:14 PM UTC, original submission:

The linking stage of the 'lib' directory fails with SunStudio 12.1 on Solaris 10 Sparc and Oracle Solaris Studio 12.2 on Solaris 11 Express Sparc with the following message:

CC -G -o libmysqlpp.so.3 mysqlpp_beemutex.o mysqlpp_cmdline.o mysqlpp_connection.o mysqlpp_cpool.o mysqlpp_datetime.o mysqlpp_dbdriver.o mysqlpp_field_names.o mysqlpp_field_types.o mysqlpp_manip.o mysqlpp_myset.o mysqlpp_mysql++.o mysqlpp_mystring.o mysqlpp_null.o mysqlpp_options.o mysqlpp_qparms.o mysqlpp_query.o mysqlpp_result.o mysqlpp_row.o mysqlpp_scopedconnection.o mysqlpp_sql_buffer.o mysqlpp_sqlstream.o mysqlpp_ssqls2.o mysqlpp_stadapter.o mysqlpp_tcp_connection.o mysqlpp_transaction.o mysqlpp_type_info.o mysqlpp_uds_connection.o mysqlpp_utility.o mysqlpp_vallist.o mysqlpp_wnp_connection.o -h libmysqlpp.so.3 -lmysqlclient -lnsl -lsocket -lm -lz -L/opt/pd/mysql5/lib -lintl -lnsl -lsocket
ld: fatal: library -lmysqlclient: not found
ld: fatal: File processing errors. No output written to libmysqlpp.so.3

However the mysqlclient library can be found in '/opt/pd/mysql5/lib'. The problem is that the -L option which points to the directory comes after the -l that includes the library, whereas the Sun Studio linker requires that first the search path is given and after that the library that can be found with that search path.

The Makefile has the following lines to build the libmysqlpp.so library:

$(DLLPREFIX)mysqlpp$(__mysqlpp___targetsuf3): $(MYSQLPP_OBJECTS) lib/ssqls.h lib/querydef.h
$(SHARED_LD_CXX) $@ $(MYSQLPP_OBJECTS) $(__mysqlpp___importlib) $(__mysqlpp___soname_flags) $(__mysqlpp___macinstnamecmd) -lmysqlclient -lnsl -lsocket -lm -lz $(LDFLAGS) $(LIBS)

Now I set the location of the mysqlclient library during configuration:

./configure --with-mysql=/opt/pd/mysql5

I updated the Makefile and moved the $(LDFLAGS) in front of the -lmysqlclient switch. This fixed the issue. Then unfortunately I had to do the same thing with all other linkings.

I suppose the Makefile is created via bakefile and automake, but I have not been able to find a way to change the order of the linker flags.

Arjan Hulsbosch <ahulsbos>

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ahulsbos (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup