 |
|
| Computers Forum Index » Computer - Databases - Berkeley » Linking error |
|
Page 1 of 4 Goto page 1, 2, 3, 4 Next |
|
| Author |
Message |
| PG |
Posted: Wed Mar 05, 2008 3:19 am |
|
|
|
Guest
|
I am trying to compile a simple ODBC and C example on Windows XP SP2.
I have Cygwin_NT 5.1.
This is the code (obtained from
http://www.easysoft.com/developer/languages/c/odbc_tutorial.html#dm_fns_drivers)
i am attempting to compile.
ODBCTest.c
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
main() {
SQLHENV env;
char dsn[256];
char desc[256];
SQLSMALLINT dsn_ret;
SQLSMALLINT desc_ret;
SQLUSMALLINT direction;
SQLRETURN ret;
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
direction = SQL_FETCH_FIRST;
while(SQL_SUCCEEDED(ret = SQLDataSources(env, direction,
dsn, sizeof(dsn), &dsn_ret,
desc, sizeof(desc), &desc_ret))) {
direction = SQL_FETCH_NEXT;
printf("%s - %s\n", dsn, desc);
if (ret == SQL_SUCCESS_WITH_INFO) printf("\tdata truncation\n");
}
}
Makefile
INCPATH=-I/usr/include -Iinclude
LIBS=-L. -lodbc32
LD=ld
all: clean ODBCTest.exe
ODBCTest.o : ODBCTest.c
$(CC) $(INCPATH) $(CFLAGS) -o ODBCTest.o -c ODBCTest.c
ODBCTest.exe : ODBCTest.o
$(CC) $(LIBS) $(CFLAGS) -o ODBCTest.exe ODBCTest.o
clean:
-rm *.o
-rm *.exe
Make output and Errors:
rm *.o
rm *.exe
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c .text+0x4a): undefined reference to
`_SQLAllocHandle@12'
ODBCTest.o:ODBCTest.c .text+0x70): undefined reference to
`_SQLSetEnvAttr@16'
ODBCTest.o:ODBCTest.c .text+0xca): undefined reference to
`_SQLDataSources@32'
collect2: ld returned 1 exit status
make: *** [ODBCTest.exe] Error 1
Things i have checked:
libodbc32.a exists in c:\cygwin\lib\w32api.
If i remove the above lib, i get a "lib not found" kind of error when
i run make, meaning this is the lib make is using and there is no path
issue.
if i edit libodbc32.a in a binary editor, i can see the all the three
functions mentioned in the error (_SQLAllocHandle@12,
_SQLSetEnvAttr@16 and _SQLDataSources@32) exist.
How can i fix these linking errors?
Thanks
PG |
|
|
| Back to top |
|
|
|
| Jerry Stuckle |
Posted: Wed Mar 05, 2008 9:24 am |
|
|
|
Guest
|
PG wrote:
Quote: I am trying to compile a simple ODBC and C example on Windows XP SP2.
I have Cygwin_NT 5.1.
This is the code (obtained from
http://www.easysoft.com/developer/languages/c/odbc_tutorial.html#dm_fns_drivers)
i am attempting to compile.
snip
Things i have checked:
libodbc32.a exists in c:\cygwin\lib\w32api.
If i remove the above lib, i get a "lib not found" kind of error when
i run make, meaning this is the lib make is using and there is no path
issue.
if i edit libodbc32.a in a binary editor, i can see the all the three
functions mentioned in the error (_SQLAllocHandle@12,
_SQLSetEnvAttr@16 and _SQLDataSources@32) exist.
How can i fix these linking errors?
Thanks
PG
1. Get rid of the funny graphics in your messages.
2. Try an ODBC newsgroup. libodbc32 is not a MySQL library
3. Don't even think of crossposting to every SQL-related newsgroup you
can find. Such will get you no help at all.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
================== |
|
|
| Back to top |
|
|
|
| Huber Hans |
Posted: Wed Mar 05, 2008 2:56 pm |
|
|
|
Guest
|
PG schrieb:
Quote: I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c .text+0x4a): undefined reference to
`_SQLAllocHandle@12'
no -L/lib/w32api :-)
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans |
|
|
| Back to top |
|
|
|
| PG |
Posted: Wed Mar 05, 2008 4:18 pm |
|
|
|
Guest
|
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu...@gmail.com> wrote:
Quote: PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle@12'
no -L/lib/w32api :-)
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans |
|
|
| Back to top |
|
|
|
| PG |
Posted: Wed Mar 05, 2008 4:25 pm |
|
|
|
Guest
|
Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa...@gmail.com> wrote:
Quote: 1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu...@gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle@12'
no -L/lib/w32api :-)
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans |
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
| Huber Hans... |
Posted: Thu Mar 06, 2008 3:11 am |
|
|
|
Guest
|
PG schrieb:
Quote: Sorry accidentally posted last response before i finished the post.
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
gcc was able to find libodbc32.a without specifying -L/lib/w32api.
if -L. works, then either libodbc32.a is in your current directory or
/lib/w32api is set in ld.so.conf
Cheers Hans
Quote:
Thanks Hans
PG
On Mar 5, 8:18 am, PG <gosa... at (no spam) gmail.com> wrote:
1. I realized this was a gcc problem so in order to debug the issue, i
stopped using make. i simply started using the gcc command on command
line.
2. On my machine the following two commands produced the same output
(error)
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
and
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o
On Mar 5, 12:56 am, Huber Hans <hans.hu... at (no spam) gmail.com> wrote:
PG schrieb:
I did not know if this was a problem with makefile, cygwin, or the
specific odbc library, hence i submitted this question to multiple
groups.
Anyway, after some more work, found out that the makefile is resulting
in this command
gcc -L/lib/w32api -lodbc32 -o ODBCTest.exe ODBCTest.o <-- Fails with
link errors.
But that is not what you posted earlier on, see your previously posted
error output:
rm: cannot remove `*.exe': No such file or directory
make: [clean] Error 1 (ignored)
gcc -I/usr/include -Iinclude -o ODBCTest.o -c ODBCTest.c
gcc -L. -lodbc32 -o ODBCTest.exe ODBCTest.o
ODBCTest.o:ODBCTest.c  .text+0x4a): undefined reference to
`_SQLAllocHandle at (no spam) 12'
no -L/lib/w32api
And hey, this is has nothing to do with databases, this is a simple
gcc,make problem!
Cheers Hans
|
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Sun Dec 06, 2009 4:16 pm
|
|