comp.lang.ada
 help / color / mirror / Atom feed
* collect2: ld returned 1 exit status
@ 2013-08-15 10:22 Dwiki
  2013-08-15 12:27 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 4+ messages in thread
From: Dwiki @ 2013-08-15 10:22 UTC (permalink / raw)


hello,
i try to compile a source code using gnade, but it show error 

c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqldatasources':
c:/gnade/win32-include/gnu-db-sqlcli.adb:496: undefined reference to `_SQLDataSources@40'
c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqldrivers__2':
c:/gnade/win32-include/gnu-db-sqlcli.adb:590: undefined reference to `_SQLDrivers@40'
c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqldescribeparam':
c:/gnade/win32-include/gnu-db-sqlcli.adb:1291: undefined reference to `_SQLDescribeParam@40'
c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqlgetcursorname':
c:/gnade/win32-include/gnu-db-sqlcli.adb:1478: undefined reference to `_SQLGetCursorName@20'
c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqldescribecol':
c:/gnade/win32-include/gnu-db-sqlcli.adb:2610: undefined reference to `_SQLDescribeCol@56'
c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqlnativesql':
c:/gnade/win32-include/gnu-db-sqlcli.adb:2811: undefined reference to `_SQLNativeSql@28'
c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqlbrowseconnect':
c:/gnade/win32-include/gnu-db-sqlcli.adb:2960: undefined reference to `_SQLBrowseConnect@28'
c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqldriverconnect':
c:/gnade/win32-include/gnu-db-sqlcli.adb:3053: undefined reference to `_SQLDriverConnect@36'
c:\gnade\gnu-db-sqlcli-environment_attribute.o: In function `gnu__db__sqlcli__environment_attribute__get_env_attr':
c:/gnade/win32-include/gnu-db-sqlcli-environment_attribute.adb:53: undefined reference to `_SQLGetEnvAttr@24'
c:\gnade\gnu-db-sqlcli-info.o: In function `gnu__db__sqlcli__info__sqlgetfunctions':
c:/gnade/win32-include/gnu-db-sqlcli-info.adb:149: undefined reference to `_SQLGetFunctions@16'
c:\gnade\gnu-db-sqlcli-info.o: In function `gnu__db__sqlcli__info__sqlgetfunctions__2':
c:/gnade/win32-include/gnu-db-sqlcli-info.adb:175: undefined reference to `_SQLGetFunctions@16'
collect2: ld returned 1 exit status

ive seen another thread facing same problem in
https://groups.google.com/forum/#!searchin/comp.lang.ada/gesql/comp.lang.ada/fbzq3IkGSy8/mcAKkSraiCQJ

i have add -lodbc32 but the error still there.

do i missed something?

thank you....

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

* Re: collect2: ld returned 1 exit status
  2013-08-15 10:22 collect2: ld returned 1 exit status Dwiki
@ 2013-08-15 12:27 ` Dmitry A. Kazakov
  2013-08-16  2:38   ` Dwiki
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry A. Kazakov @ 2013-08-15 12:27 UTC (permalink / raw)


On Thu, 15 Aug 2013 03:22:59 -0700 (PDT), Dwiki wrote:

> i try to compile a source code using gnade, but it show error 
> 
> c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqldatasources':
> c:/gnade/win32-include/gnu-db-sqlcli.adb:496: undefined reference to `_SQLDataSources@40'

Use nm to list entry points of the dll, e.g.

$ nm odbc32.lib

In particular SQLDataSources shows:

00000000 I .idata$4
00000000 I .idata$5
00000000 T .text
00000000 I __imp__SQLDataSources@32
         U __IMPORT_DESCRIPTOR_ODBC32
00000000 T _SQLDataSources@32

> i have add -lodbc32 but the error still there.
> 
> do i missed something?

@N suffix of a decorated name indicates the number of bytes the operation
uses for its arguments (stdcall convention).

Since you have it wrong, that suggests the version of GNADE you are using
deploys wrong types for the arguments of SQLDataSource. Which should not be
very surprising, because as I said before, MS had sufficiently changed the
ODBC API in order to accommodate 64-bit applications, which happened
*after* the last time GNADE was maintained. Possibly, you are compiling for
64-bit instead of 32-bit.

If you are up to revive GNADE ODBC, here is the MS page describing the
changes:

http://support.microsoft.com/kb/298678

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

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

* Re: collect2: ld returned 1 exit status
  2013-08-15 12:27 ` Dmitry A. Kazakov
@ 2013-08-16  2:38   ` Dwiki
  2013-08-16  6:55     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 4+ messages in thread
From: Dwiki @ 2013-08-16  2:38 UTC (permalink / raw)


Pada Kamis, 15 Agustus 2013 19:27:15 UTC+7, Dmitry A. Kazakov  menulis:
> On Thu, 15 Aug 2013 03:22:59 -0700 (PDT), Dwiki wrote:
> 
> 
> 
> > i try to compile a source code using gnade, but it show error 
> 
> > 
> 
> > c:\gnade\gnu-db-sqlcli.o: In function `gnu__db__sqlcli__sqldatasources':
> 
> > c:/gnade/win32-include/gnu-db-sqlcli.adb:496: undefined reference to `_SQLDataSources@40'
> 
> 
> 
> Use nm to list entry points of the dll, e.g.
> 
> 
> 
> $ nm odbc32.lib
> 
> 
> 
> In particular SQLDataSources shows:
> 
> 
> 
> 00000000 I .idata$4
> 
> 00000000 I .idata$5
> 
> 00000000 T .text
> 
> 00000000 I __imp__SQLDataSources@32
> 
>          U __IMPORT_DESCRIPTOR_ODBC32
> 
> 00000000 T _SQLDataSources@32
> 
> 
> 
> > i have add -lodbc32 but the error still there.
> 
> > 
> 
> > do i missed something?
> 
> 
> 
> @N suffix of a decorated name indicates the number of bytes the operation
> 
> uses for its arguments (stdcall convention).
> 
> 
> 
> Since you have it wrong, that suggests the version of GNADE you are using
> 
> deploys wrong types for the arguments of SQLDataSource. Which should not be
> 
> very surprising, because as I said before, MS had sufficiently changed the
> 
> ODBC API in order to accommodate 64-bit applications, which happened
> 
> *after* the last time GNADE was maintained. Possibly, you are compiling for
> 
> 64-bit instead of 32-bit.
> 
> 
> 
> If you are up to revive GNADE ODBC, here is the MS page describing the
> 
> changes:
> 
> 
> 
> http://support.microsoft.com/kb/298678
> 
> 
> 
> -- 
> 
> Regards,
> 
> Dmitry A. Kazakov
> 
> http://www.dmitry-kazakov.de

Dmitry, i think i dont understand the page :(
for example with this section 
Changes in SQL Data Types
#ifdef WIN32
typedef SQLULEN SQLROWCOUNT;
typedef SQLULEN SQLROWSETSIZE;
typedef SQLULEN SQLTRANSID;
typedef SQLLEN SQLROWOFFSET;
#endif

what should i do then in my ADA code? ive been searching similar code in GNADE but i cant, do you have another clue?.

FYI, there is warning 
"warning: no compiler specified for language 'Gesql', ignoring all its sources Builder"
can i just ignore it?

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

* Re: collect2: ld returned 1 exit status
  2013-08-16  2:38   ` Dwiki
@ 2013-08-16  6:55     ` Dmitry A. Kazakov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry A. Kazakov @ 2013-08-16  6:55 UTC (permalink / raw)


On Thu, 15 Aug 2013 19:38:11 -0700 (PDT), Dwiki wrote:

> Dmitry, i think i dont understand the page :(
> for example with this section 
> Changes in SQL Data Types
> #ifdef WIN32
> typedef SQLULEN SQLROWCOUNT;
> typedef SQLULEN SQLROWSETSIZE;
> typedef SQLULEN SQLTRANSID;
> typedef SQLLEN SQLROWOFFSET;
> #endif
> 
> what should i do then in my ADA code?

You look where old API used for example SQLROWCOUNT and replace it with
SQLULEN.

> ive been searching similar code in
> GNADE but i cant, do you have another clue?

You should go through the list of all types and all functions from the
document and verify their GNADE ODBC counterparts. You should use 64-bit
integers fro SQLLEN for 64-bit applications and 32-bit for 32-bit
applications.

Yes, it is a lot of work, 100% code review + much testing afterwards.

> FYI, there is warning 
> "warning: no compiler specified for language 'Gesql', ignoring all its sources Builder"
> can i just ignore it?

Probably yes, it looks like from the project file, something for embedded
SQL support.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

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

end of thread, other threads:[~2013-08-16  6:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 10:22 collect2: ld returned 1 exit status Dwiki
2013-08-15 12:27 ` Dmitry A. Kazakov
2013-08-16  2:38   ` Dwiki
2013-08-16  6:55     ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox