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 

C-programming with mysql

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



Joined: 12 Sep 2011
Posts: 12

PostPosted: Fri Sep 23, 2011 6:01 pm    Post subject: C-programming with mysql Reply with quote

Hi,

what do I need in order to write c-programms that uses mysql-header and -routines?

I have copied the *.h-files from ...include]-Directory to sys$common:[syslib]
Now the cc-compiler finds #include <my_global.h> etc..

But $LINK say %LINK-I-UDFSYM for all mysql-routines, like
- MYSQL_CLOSE
- MYSQL_ERRNO
- MYSQL_ERROR
-MYSQL_INIT
-MYSQL_QUERY
...

Where can I find these routines and how can I add them to the default?

Regards, Frank
Back to top
View user's profile Send private message
FWeichert



Joined: 12 Sep 2011
Posts: 12

PostPosted: Tue Sep 27, 2011 7:10 pm    Post subject: Reply with quote

Hi,

some things I found in this forum, but the $linker still shows a lot of
error-messages.

This is a little example:

$ type version.c
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <my_global.h>
#include <mysql.h>

int main(int argc, char **argv)
{
printf("MySQL client version: %s\n", mysql_get_client_info());
}
$ type cc.com

$CC /float=ieee/ieee=denorm -
/include=SQL_DISK:[MYSQL.MYSQL051.INCLUDE] 'P1

$@cc version
$
$ type link.com

$ LINK 'P1+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_upper.olb/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBSSL_MIXED.OLB/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBCRYPTO_MIXED.OLB/lib

$ @link version
%LINK-W-NUDFSYMS, 41 undefined symbols:
%LINK-I-UDFSYM, BN_BIN2BN
%LINK-I-UDFSYM, COMPRESS
%LINK-I-UDFSYM, DH_FREE
%LINK-I-UDFSYM, DH_NEW
%LINK-I-UDFSYM, ERR_GET_ERROR_LINE_DATA
%LINK-I-UDFSYM, OPENSSL_ADD_ALL_ALGO_NOCONF
%LINK-I-UDFSYM, SSL_ACCEPT
%LINK-I-UDFSYM, SSL_CIPHER_GET_NAME
%LINK-I-UDFSYM, SSL_CLEAR
%LINK-I-UDFSYM, SSL_CONNECT
%LINK-I-UDFSYM, SSL_CTX_CHECK_PRIVATE_KEY
%LINK-I-UDFSYM, SSL_CTX_CTRL
%LINK-I-UDFSYM, SSL_CTX_FREE
%LINK-I-UDFSYM, SSL_CTX_LOAD_VERIFY_LOCATIONS
%LINK-I-UDFSYM, SSL_CTX_NEW
%LINK-I-UDFSYM, SSL_CTX_SET_CIPHER_LIST
...
%LINK-W-USEUNDEF, undefined symbol SSL_CTX_SET_SESSION_ID_CONTEXT referenced
in psect $LINK$ offset %X00000240
in module VIOSSLFACTORIES file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlcli
ent_upper.olb;1
%LINK-W-USEUNDEF, undefined symbol TLSV1_CLIENT_METHOD referenced
in psect $LINK$ offset %X00000270
in module VIOSSLFACTORIES file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlcli
ent_upper.olb;1



$ RUN VERSION
MySQL client version: 5.1.46
$

The EXE-File works fine. But why there are all this Linker-messages?
What is missing?

Regards, Frank
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Thu Sep 29, 2011 10:30 am    Post subject: Reply with quote

Hello Frank,

Try to compile using /name=(as_is, short)

And only link only with the *_mixed libraries, don't used the *_upper ones.

Regards,

Jean-François
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FWeichert



Joined: 12 Sep 2011
Posts: 12

PostPosted: Thu Sep 29, 2011 6:11 pm    Post subject: Reply with quote

Hello Jean-François

now this happens:

$ @link version
$ LINK VERSION+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBSSL_MIXED.OLB/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBCRYPTO_MIXED.OLB/lib
%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM, compress
%LINK-I-UDFSYM, uncompress
%LINK-W-USEUNDEF, undefined symbol compress referenced
in psect $LINK$ offset %X00000050
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
%LINK-W-USEUNDEF, undefined symbol uncompress referenced
in psect $LINK$ offset %X000000B0
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
$!

Regards, Frank
Back to top
View user's profile Send private message
FWeichert



Joined: 12 Sep 2011
Posts: 12

PostPosted: Thu Sep 29, 2011 6:11 pm    Post subject: Reply with quote

Hello Jean-François

now this happens:

$ @link version
$ LINK VERSION+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBSSL_MIXED.OLB/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBCRYPTO_MIXED.OLB/lib
%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM, compress
%LINK-I-UDFSYM, uncompress
%LINK-W-USEUNDEF, undefined symbol compress referenced
in psect $LINK$ offset %X00000050
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
%LINK-W-USEUNDEF, undefined symbol uncompress referenced
in psect $LINK$ offset %X000000B0
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
$!

Regards, Frank
Back to top
View user's profile Send private message
FWeichert



Joined: 12 Sep 2011
Posts: 12

PostPosted: Thu Sep 29, 2011 6:12 pm    Post subject: Reply with quote

Hello Jean-François

now this happens:

$ @link version
$ LINK VERSION+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBSSL_MIXED.OLB/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBCRYPTO_MIXED.OLB/lib
%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM, compress
%LINK-I-UDFSYM, uncompress
%LINK-W-USEUNDEF, undefined symbol compress referenced
in psect $LINK$ offset %X00000050
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
%LINK-W-USEUNDEF, undefined symbol uncompress referenced
in psect $LINK$ offset %X000000B0
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
$!

Regards, Frank
Back to top
View user's profile Send private message
FWeichert



Joined: 12 Sep 2011
Posts: 12

PostPosted: Thu Sep 29, 2011 6:13 pm    Post subject: Reply with quote

Hello Jean-François

now this happens:

$ @link version
$ LINK VERSION+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBSSL_MIXED.OLB/lib+ -
SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]LIBCRYPTO_MIXED.OLB/lib
%LINK-W-NUDFSYMS, 2 undefined symbols:
%LINK-I-UDFSYM, compress
%LINK-I-UDFSYM, uncompress
%LINK-W-USEUNDEF, undefined symbol compress referenced
in psect $LINK$ offset %X00000050
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
%LINK-W-USEUNDEF, undefined symbol uncompress referenced
in psect $LINK$ offset %X000000B0
in module my_compress file SQL_DISK:[MYSQL.MYSQL051.VMS.LIB]mysqlclient_mixed.olb;1
$!

Regards, Frank
Back to top
View user's profile Send private message
FWeichert



Joined: 12 Sep 2011
Posts: 12

PostPosted: Thu Sep 29, 2011 6:17 pm    Post subject: Reply with quote

Sorry for sending the same text several times. I got an error-message after submitting
Back to top
View user's profile Send private message
FWeichert



Joined: 12 Sep 2011
Posts: 12

PostPosted: Thu Sep 29, 2011 6:17 pm    Post subject: Reply with quote

Sorry for sending the same text several times. I got an error-message after submitting

Ran into problems sending Mail. Response: 500 Syntax error, command unrecognized

DEBUG MODE

Line : 126
File : smtp.php
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Thu Sep 29, 2011 7:05 pm    Post subject: Reply with quote

You need to link with zlib which define compress/decompress symbols.


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



Joined: 12 Sep 2011
Posts: 12

PostPosted: Fri Sep 30, 2011 6:18 pm    Post subject: Reply with quote

Hello Jean-François,

many thanks, now it works fine.

This is a little DCL-Script:

$! P1 = Filename without extension
$ SET VERIF
$ CC -
/float=ieee -
/ieee=denorm -
/name=(as_is,short) -
/include=MYSQL051_ROOT:[INCLUDE] -
'P1
$ IF $STATUS
$ THEN
$ LINK 'P1+ -
MYSQL051_ROOT:[VMS.LIB]mysqlclient_mixed.olb/lib+ -
MYSQL051_ROOT:[VMS.LIB]LIBSSL_MIXED.OLB/lib+ -
MYSQL051_ROOT:[VMS.LIB]LIBCRYPTO_MIXED.OLB/lib+ -
SYS$COMMON:[LIBZ]LIBZ.OLB/lib
$ ELSE
$ write sys$output "CC-Error ''P1'.C ----> Exit"
$ ENDIF
$ SET NOVERIF

---
Regards, Frank
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