public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Getting Error while connect to DB2 from Cygwin 64-bit
@ 2023-04-04  7:02 rajesh kesavan
  2023-04-04  7:54 ` Andrey Repin
  0 siblings, 1 reply; 4+ messages in thread
From: rajesh kesavan @ 2023-04-04  7:02 UTC (permalink / raw)
  To: cygwin, cygwin-owner, mailman, cygwin-developers,
	cygwin-developers-owner
  Cc: aashishchavan, sivaji.cdev, atulpathare226

[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]

Hi,

I'm getting below errors while trying to connect IBM DB2 from 64-bit
Cygwin. Please find the below mentioned details.

1)Trying to compile the program using DB2_LIBRARY="C:/Program
Files/IBM/SQLLIB/lib/db2api.lib" on 64-bit Cygwin.

*ERROR:*
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *internal
error:* aborting at
/mnt/share/cygpkgs/binutils/binutils.x86_64/src/binutils-2.40/ld/ldlang.c:527
in compare_section
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *please
report this bug*


2)When Trying to compile using DB2_LIBRARY="C:/Program
Files/IBM/SQLLIB/lib/Win32/db2api.lib" on 64-bit Cygwin.

*ERROR:*
undefined reference to `sqlacall'
undefined reference to `sqlastop'
undefined reference to `sqlaaloc'
undefined reference to `sqlasetdata'
undefined reference to `sqlastrt'

[*Note :* the same is working fine on 32 bit Cygwin using
DB2_LIBRARY="C:/Program Files/IBM/SQLLIB/lib/Win32/db2api.lib"]

3)Compilation is done but getting an error while Trying to connect IBM DB2
using DB2_LIBRARY="C:/Program Files/IBM/SQLLIB/BIN/db2app64.dll" on 64-bit
Cygwin.

*ERROR:*
sqlcode=*808517647*

This "*sqlcode=808517647*" error code looks like an abnormal error and it
is not present in db2 documents.

*Details:*
$ gcc --version
*gcc (GCC) 11.3.0*
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ld --version
*GNU ld (GNU Binutils) 2.40*
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later
version.
This program has absolutely no warranty.


Please let me know if you want more details.



Thanks and Regards,
Rajesh K.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting Error while connect to DB2 from Cygwin 64-bit
  2023-04-04  7:02 Getting Error while connect to DB2 from Cygwin 64-bit rajesh kesavan
@ 2023-04-04  7:54 ` Andrey Repin
  2023-04-04 19:55   ` Brian Inglis
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Repin @ 2023-04-04  7:54 UTC (permalink / raw)
  To: rajesh kesavan, cygwin

Greetings, rajesh kesavan!

> I'm getting below errors while trying to connect IBM DB2 from 64-bit
> Cygwin. Please find the below mentioned details.

> 1)Trying to compile the program using DB2_LIBRARY="C:/Program
> Files/IBM/SQLLIB/lib/db2api.lib" on 64-bit Cygwin.

Is this a Cygwin or native target binary?

> *ERROR:*
> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *internal
> error:* aborting at
> /mnt/share/cygpkgs/binutils/binutils.x86_64/src/binutils-2.40/ld/ldlang.c:527
> in compare_section
> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *please
> report this bug*

It seems to me you are trying to mix Cygwin and native Windows code.
Don't do that without a very, very good understanding of implications.
If you are building using binary code provided by 3rd party vendor,
chances are high you are looking at native code and you have to use mingw32
cross-compiler for that build.

> 3)Compilation is done but getting an error while Trying to connect IBM DB2
> using DB2_LIBRARY="C:/Program Files/IBM/SQLLIB/BIN/db2app64.dll" on 64-bit
> Cygwin.

> *ERROR:*
> sqlcode=*808517647*

> This "*sqlcode=808517647*" error code looks like an abnormal error and it
> is not present in db2 documents.

> *Details:*
> $ gcc --version
> *gcc (GCC) 11.3.0*
> Copyright (C) 2021 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> $ ld --version
> *GNU ld (GNU Binutils) 2.40*
> Copyright (C) 2023 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) a later
> version.
> This program has absolutely no warranty.


> Please let me know if you want more details.


-- 
With best regards,
Andrey Repin
Tuesday, April 4, 2023 10:33:35

Sorry for my terrible english...


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting Error while connect to DB2 from Cygwin 64-bit
  2023-04-04  7:54 ` Andrey Repin
@ 2023-04-04 19:55   ` Brian Inglis
  2023-04-04 20:13     ` Brian Inglis
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Inglis @ 2023-04-04 19:55 UTC (permalink / raw)
  To: cygwin; +Cc: rajesh kesavan

On 2023-04-04 01:54, Andrey Repin wrote:
>> I'm getting below errors while trying to connect IBM DB2 from 64-bit
>> Cygwin. Please find the below mentioned details.
> 
>> 1)Trying to compile the program using DB2_LIBRARY="C:/Program
>> Files/IBM/SQLLIB/lib/db2api.lib" on 64-bit Cygwin.
> 
> Is this a Cygwin or native target binary?
> 
>> *ERROR:*
>> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *internal
>> error:* aborting at
>> /mnt/share/cygpkgs/binutils/binutils.x86_64/src/binutils-2.40/ld/ldlang.c:527
>> in compare_section
>> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *please
>> report this bug*

> It seems to me you are trying to mix Cygwin and native Windows code.
> Don't do that without a very, very good understanding of implications.
> If you are building using binary code provided by 3rd party vendor,
> chances are high you are looking at native code and you have to use mingw32
> cross-compiler for that build.

Presumably these are Windows libraries so you liekly have to use Mingw binutils 
mingw64-x86_64-binutils /usr/x86_64-w64-mingw32/bin/ and mingw64-x86_64-gcc-core 
/usr/lib/gcc/x86_64-w64-mingw32/11/ packages under their respective paths, after 
reading up more about how to use them.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting Error while connect to DB2 from Cygwin 64-bit
  2023-04-04 19:55   ` Brian Inglis
@ 2023-04-04 20:13     ` Brian Inglis
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2023-04-04 20:13 UTC (permalink / raw)
  To: cygwin; +Cc: rajesh kesavan

On 2023-04-04 13:55, Brian Inglis via Cygwin wrote:
> On 2023-04-04 01:54, Andrey Repin wrote:
>>> I'm getting below errors while trying to connect IBM DB2 from 64-bit
>>> Cygwin. Please find the below mentioned details.
>>> 1)Trying to compile the program using DB2_LIBRARY="C:/Program
>>> Files/IBM/SQLLIB/lib/db2api.lib" on 64-bit Cygwin.

>> Is this a Cygwin or native target binary?

>>> *ERROR:*
>>> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *internal
>>> error:* aborting at
>>> /mnt/share/cygpkgs/binutils/binutils.x86_64/src/binutils-2.40/ld/ldlang.c:527
>>> in compare_section
>>> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: *please
>>> report this bug*

>> It seems to me you are trying to mix Cygwin and native Windows code.
>> Don't do that without a very, very good understanding of implications.
>> If you are building using binary code provided by 3rd party vendor,
>> chances are high you are looking at native code and you have to use mingw32
>> cross-compiler for that build.

> Presumably these are Windows libraries so you liekly have to use Mingw binutils 
> mingw64-x86_64-binutils /usr/x86_64-w64-mingw32/bin/ and mingw64-x86_64-gcc-core 
> /usr/lib/gcc/x86_64-w64-mingw32/11/ packages under their respective paths, after 
> reading up more about how to use them.

Or not:		https://www.ibm.com/docs/en/db2/11.5?topic=compilers-c

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-04 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04  7:02 Getting Error while connect to DB2 from Cygwin 64-bit rajesh kesavan
2023-04-04  7:54 ` Andrey Repin
2023-04-04 19:55   ` Brian Inglis
2023-04-04 20:13     ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).