Xlc also creates an executable but same errors I believe
xlc -q64 `mysql_config --cflags` \
-o version version.c \
`mysql_config --libs`
P8:/home/myc/TEST>./version
exec(): 0509-036 Cannot load program version because of the following errors:
0509-130 Symbol resolution failed for /opt/freeware/lib/libmysqlclient.a
[libmysqlclient.so.21] because:
0509-136 Symbol _ZSt11__once_call (number 177) is not exported from
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-136 Symbol _ZSt15__once_callable (number 178) is not exported fro
m
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-136 Symbol __once_proxy (number 193) is not exported from
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-192 Examine .loader section symbols with the
'dump -Tv' command.
Xlc with extra option -qthreaded also same error when running the executable
xlc -q64 -qthreaded `mysql_config --cflags` \
-o version version.c \
`mysql_config --libs`
P8:/home/myc/TEST>./version
exec(): 0509-036 Cannot load program version because of the following errors:
0509-130 Symbol resolution failed for /opt/freeware/lib/libmysqlclient.a
[libmysqlclient.so.21] because:
0509-136 Symbol _ZSt11__once_call (number 177) is not exported from
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-136 Symbol _ZSt15__once_callable (number 178) is not exported fro
m
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-136 Symbol __once_proxy (number 193) is not exported from
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-192 Examine .loader section symbols with the
'dump -Tv' command.

https://be.foamglas.com/nl-be/homepage
The information contained in this communication and its attachment(s) is intended only for the use of the individual to whom it is addressed and
may contain information that is privileged, confidential, or exempt from disclosure. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this
communication in error, please notify
postmaster@owenscorning.com and delete the communication without retaining any copies. Thank you.
Translations available:
http://www.owenscorning.com/emailfooter.html
Original Message:
Sent: 4/8/2022 9:52:00 AM
From: Ayappan P
Subject: RE: C compiler doesn't find function in library
Try to compile with pthread support.
"gcc -pthread"
------------------------------
Ayappan P
------------------------------
Original Message:
Sent: Fri April 08, 2022 09:48 AM
From: Johan Volders
Subject: C compiler doesn't find function in library
Compiled with gcc and option -maix64
Executable version is created now, execution gives
P8:/home/myc/TEST>./version
exec(): 0509-036 Cannot load program version because of the following errors:
0509-130 Symbol resolution failed for /opt/freeware/lib/libmysqlclient.a
[libmysqlclient.so.21] because:
0509-136 Symbol _ZSt11__once_call (number 177) is not exported from
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-136 Symbol _ZSt15__once_callable (number 178) is not exported fro
m
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-136 Symbol __once_proxy (number 193) is not exported from
dependent module /opt/freeware/lib/libstdc++.a[libstdc++.so.6
].
0509-192 Examine .loader section symbols with the
'dump -Tv' command.
Let's try now what xlc with option -q64 does

https://be.foamglas.com/nl-be/homepage
The information contained in this communication and its attachment(s) is intended only for the use of the individual to whom it is addressed and
may contain information that is privileged, confidential, or exempt from disclosure. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this
communication in error, please notify
postmaster@owenscorning.com and delete the communication without retaining any copies. Thank you.
Translations available:
http://www.owenscorning.com/emailfooter.html
Original Message:
Sent: 4/8/2022 9:37:00 AM
From: Ayappan P
Subject: RE: C compiler doesn't find function in library
The mysql server build is 64bit. By default, AIX development env is 32bit. So you need to pass "-q64" for xlc & "-maix64" for gcc. Another option is to set OBJECT_MODE=64.
------------------------------
Ayappan P
Original Message:
Sent: Fri April 08, 2022 09:18 AM
From: Johan Volders
Subject: C compiler doesn't find function in library
Hello,
I have a working community-mysql-server 8.0.20 on aix 7.2
mysql --version
mysql Ver 8.0.20 for AIX on powerpc (Source distribution)
C-API library is installed in
ls -l /opt/freeware/lib/libmysqlclient.a
-rwxr-xr-x 1 root system 8703555 Mar 10 08:40 /opt/freeware/lib/libmysqlclient.a
When I compile following program "version.c" with IBM xlc compiler
#include <mysql.h>
#include <stdio.h>
int main()
{
printf("MySQL client version: %s\n",mysql_get_client_info());
}
xlc -c version.c -I/opt/freeware/include/mysql
a version.o object file is created that's OK, no errors while compiling to an object file
But when I compile it to an executable "version" program, the compiler doesn't find the function in the library
xlc -o version version.c -L/opt/freeware/lib -lmysqlclient
ld: 0711-317 ERROR: Undefined symbol: .mysql_get_client_info
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Is that because the the program compiled witth IBM xlc compiler is linked to libmysqlclient.a that was compiled with another compiler ?
I tried to compile with gcc-8 too but that does the same
ld: 0711-317 ERROR: Undefined symbol: .mysql_get_client_info
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
What can be the reason that compiler doesn't find the function in lib ?
Kind regards,
Johan Volders
------------------------------
Johan Volders
------------------------------