forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Link errors

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> MySQL for OpenVMS
View previous topic :: View next topic  
Author Message
tadamsmar



Joined: 28 Dec 2009
Posts: 6

PostPosted: Thu Jan 14, 2010 3:33 pm    Post subject: Link errors Reply with quote

Does anyone know how to get rid of these link warnings? Thanks!

%LINK-W-MULPSC, conflicting attributes for psect mysql_port
in module client file DSA0:[VMS$COMMON.MYSQL051.VMS.LIB]MYSQLCLIENT_MIXE
D.OLB;1
%LINK-W-MULPSC, conflicting attributes for psect mysql_unix_port
in module client file DSA0:[VMS$COMMON.MYSQL051.VMS.LIB]MYSQLCLIENT_MIXE
D.OLB;1
%LINK-W-MULPSC, conflicting attributes for psect sql_protocol_typelib
in module client file DSA0:[VMS$COMMON.MYSQL051.VMS.LIB]MYSQLCLIENT_MIXE
D.OLB;1
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Fri Jan 15, 2010 8:11 am    Post subject: Reply with quote

Which version, on which platform ?

Can you post a simple reproducer, because we have'nt this problem linking all the mysql tools.

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tadamsmar



Joined: 28 Dec 2009
Posts: 6

PostPosted: Fri Jan 15, 2010 5:08 pm    Post subject: Reply with quote

Operating system is VMS 7.3-2 on an Alpha DS10

Program:

#include "DSA0:[VMS$COMMON.MYSQL051.INCLUDE]MYSQL.H"
MYSQL *mysql;
int main()
{
mysql=mysql_init(mysql);
}

Compile and link commands:

$cc/include=sys$common:[mysql051.include]/names=as_is testc
$link testc+ -
DSA0:[VMS$COMMON.MYSQL051.VMS.LIB]MYSQLCLIENT_mixed.OLB/lib+ -
DSA0:[VMS$COMMON.MYSQL051.VMS.LIB]MYSQLCLIENT_UPPER.OLB/lib+ -
DSA0:[VMS$COMMON.MYSQL051.VMS.LIB]LIBssl_MIXEd/lib+ -
DSA0:[VMS$COMMON.MYSQL051.VMS.LIB]LIBcrypto_MIXEd/lib+ -
DSA0:[VMS$COMMON.LIBZ]libz/lib
Back to top
View user's profile Send private message
tadamsmar



Joined: 28 Dec 2009
Posts: 6

PostPosted: Fri Jan 15, 2010 7:26 pm    Post subject: Reply with quote

I figured it out.

My CC is a symbol is:

CC == "CC /NOLIST /DEBUG /NOOPT /STANDARD=VAXC /ASSUME=NOALIGN /NOMEMBER/EXTER
N_MODEL=COMMON_BLOCK /SHARE_GLBOALS /DEFINE=(__STDC__=1) /WARN=(DISABLE=(UNAVOLA
CC,ARGLISGTR255,SIGNEDKNOWN,KNRFUNC))"

If I comple with CC/EXTERN_MODEL=RELAXED_REFDEF ,which is the default, the my link errors go away.
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Sun Jan 17, 2010 10:28 am    Post subject: Reply with quote

Good,

you must also add
Code:
/float=ieee/ieee=denorm


JFP
Back to top
View user's profile Send private message Send e-mail Visit poster's website
faisalhidayat



Joined: 16 Feb 2010
Posts: 4

PostPosted: Tue Feb 16, 2010 4:08 am    Post subject: Reply with quote

I also copied a simple program from my friend and failed to link. Here is the code:
Code:

#include <DSA0:[SYS1.SYSCOMMON.MYSQL051.INCLUDE]mysql.h>
#include <stdio.h>

main() {
   MYSQL *conn;
   MYSQL_RES *res;
   MYSQL_ROW row;

   char *server = "localhost";
   char *user = "root";
   char *password = "";
   char *database = "coba";
   
   conn = mysql_init(NULL);
   
   /* Connect to database */
   if (!mysql_real_connect(conn, server,
         user, password, database, 0, NULL, 0)) {
      fprintf(stderr, "%s\n", mysql_error(conn));
      return;
   }

   /* send SQL query */
   if (mysql_query(conn, "insert into test (id,nama) values (1,'Faisal')")) {
      fprintf(stderr, "%s\n", mysql_error(conn));
      return;
   }

   res = mysql_use_result(conn);
   
   /* output fields 1 and 2 of each row */
   while ((row = mysql_fetch_row(res)) != NULL)
      printf("%s %s\n", row[1], row[2]);

   /* Release memory used to store results and close connection */
   mysql_free_result(res);
   mysql_close(conn);
}


and I compiled with this:
Code:

cc /NoDebug/Optimize/FLOAT=IEEE_FLOAT/NOOPT/STANDARD=VAXC/EXTERN_MODEL=RELAXED_REFDEF coba.c


Here is the link command:
Code:

link coba.obj,coba.opt/opt


with the coba.opt (which I copied from other forum thread about linking php-mysql library) file:
Code:

!
! Image Ident
!
!IDENTIFICATION="MYSQL V1.3"             ! VMS port version
!BUILD_IDENT="PHP V4.3.10"               ! PHP release build
!
! Shareables
!
!APACHE$ROOT:[PHP.BIN]PHPSHR/Share                            ! PHP Shareable
MYSQL051_ROOT:[VMS.LIB]mysqlclient_upper/lib
!LIBSSL_SHR32/share
!LIBCRYPTO_SHR32/share
SYS$LIBRARY:SSL$LIBSSL_SHR32/share
SYS$LIBRARY:SSL$LIBCRYPTO_SHR32/share
SYS$LIBRARY:PTHREAD$RTL/share
SYS$LIBRARY:PTHREAD$DBGSHR/share
LIBZ_SHR32/share
!
! symbol vector detailing the globals exported by the shareable image.
!
!symbol_vector=(GET_MODULE=PROCEDURE)


I found the following error when linking:
Code:

%ILINK-W-NUDFSYMS, 2 undefined symbols:
%ILINK-I-UDFSYM,        MY_TIME
%ILINK-I-UDFSYM,        THD_LIB_DETECTED
%ILINK-W-USEUNDEF, undefined symbol MY_TIME referenced
        section: $CODE$
        offset: %X0000000000000270  slot: 2
        module: CLIENT
        file: MYSQL051_ROOT:[vms.lib]mysqlclient_upper.olb;1
%ILINK-W-USEUNDEF, undefined symbol MY_TIME referenced
        section: $CODE$
        offset: %X00000000000002F0  slot: 2
        module: CLIENT
        file: MYSQL051_ROOT:[vms.lib]mysqlclient_upper.olb;1
%ILINK-W-USEUNDEF, undefined symbol THD_LIB_DETECTED referenced
        section: $CODE$
        offset: %X0000000000000000  slot: 1
        module: MY_THR_INIT
        file: MYSQL051_ROOT:[vms.lib]mysqlclient_upper.olb;1
%ILINK-W-USEUNDEF, undefined symbol THD_LIB_DETECTED referenced
        section: $CODE$
        offset: %X0000000000000010  slot: 1
        module: MY_THR_INIT
        file: MYSQL051_ROOT:[vms.lib]mysqlclient_upper.olb;1


FYI, OS environment is OpenVMS 8.3 running on Intel Itanium and I install nothing but MySQL 5.1.22 downloaded from www.vmsmysql.com.

I am new to C programming, maybe there are some unnecessary parameters I added in compilation or linking. Could you suggest the proper parameter to remove the warnings?

Thanks in advance.
Back to top
View user's profile Send private message
faisalhidayat



Joined: 16 Feb 2010
Posts: 4

PostPosted: Tue Feb 16, 2010 4:26 am    Post subject: Reply with quote

I am sorry, I didn't browse all topics until I found this: http://www.pi-net.dyndns.org/piforum/viewtopic.php?t=151

It is indeed a bug in C client library of my installation package. I will download and try the new client library.

But still, would you suggest the proper (or good) compilation and linking parameter?
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Tue Feb 16, 2010 9:32 am    Post subject: Reply with quote

MySQL clients are build using " /name=(short)/float=ieee/iee=DENORM"
/name is not mandatory but probably a good idea.
There is also, for some clients, a few /warn=disable=(...)
Extract of a link option file :
Code:
MYSQL051_ROOT[VMS.LIB]mysqlclient_mixed.olb/library
LIBZ_SHR32/share

You will have to add the SL libraries for examples:

Code:

SSLLIB:LIBSSL_MIXED.OLB/LIB
SSLLIB:LIBCRYPTO_MIXED.OLB/LIB


On AXP you probably can't use the SSL libraries provided by HP because they are not build using ieee float.

You can on IA64 so it is probably safe to use:
Code:

SYS$SHARE:SSL$LIBSSL_SHR32.EXE/SHARE
SYS$SHARE:SSL$LIBCRYPTO_SHR32.EXE/SHARE


But be warned that HP kits, generally, don't provide any compatibility between each release.

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
faisalhidayat



Joined: 16 Feb 2010
Posts: 4

PostPosted: Tue Feb 16, 2010 2:12 pm    Post subject: Reply with quote

Thank you very much. I will try it tomorrow. Smile
Back to top
View user's profile Send private message
faisalhidayat



Joined: 16 Feb 2010
Posts: 4

PostPosted: Tue Jun 29, 2010 8:15 pm    Post subject: Reply with quote

Sorry, it took me a long time to do this test.

It works! I'll step further to my real case using mysql library in OpenVMS.

Thanks everyone.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> MySQL for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group