Hi,
I have an application compiled using gcc under DB2 v8 for Windows
Fixpak 12. It works fine for this fixpak.
However, if I move the application to a different DB2 fixpak (on
Windows), it does not run. (Basically it complains that "Procedure
entry point can not be found", in some place, say sqlasetdata.) If I
upgrade db2 on Windows to the same Fixpak, it works.
However, the same application works for DB2 UDB on AIX, HP-UX, Solaris
& Linux, regardless of DB2 versions (as long as it is V6 or later) and
fixpak levels.
The compilation script on Windows (with Cygwin) is as follows:
## Compile (but without link: -c) each component:
gcc -mno-cygwin -I$DB2PATH/include -c md5.c
gcc -mno-cygwin -I$DB2PATH/include -c hash.c
......
gcc -mno-cygwin -I$DB2PATH/include -c $APPNAME.c
## Link all objects to form the application:
gcc -mno-cygwin -o ${APPNAME} \
${APPNAME}.o \
md5.o \
hash.o \
...... \
$DB2PATH/lib/db2api.lib -L$DB2PATH/lib
Have I missed something during the compilation? How to make the
application work for all fixpaks lower than Fixpak 12 on Windows?
Thanks a lot!
Guoping
Mark A - 28 Sep 2006 01:32 GMT
> Hi,
>
[quoted text clipped - 33 lines]
>
> Guoping
Starting with DB2 8.2 (DB2 8.1 FP7 or higher) SQL stored procedures no
longer generate C code that is compiled using a C compiler installed by the
customer on the database server machine. Prior to 8.2, a compiler must be
installed and properly set up in order to use it for SQL SP's.
One of the manuals describes how to set up a C compiler on Windows for SP
compilation prior to 8.2. I believe it is on of the Application Development
Guides. Of course, if you go to 8.2 you don't need the C compiler.
gjiang_usenet@yahoo.com - 28 Sep 2006 05:45 GMT
Thanks Mark.
But the application is not a stored procedure. All C code is written
by me instead of being generated by a tool.
> > Hi,
> >
[quoted text clipped - 42 lines]
> compilation prior to 8.2. I believe it is on of the Application Development
> Guides. Of course, if you go to 8.2 you don't need the C compiler.
gjiang_usenet@yahoo.com - 28 Sep 2006 05:45 GMT
Thanks Mark.
But the application is not a stored procedure. All C code is written
by me instead of being generated by a tool.
> > Hi,
> >
[quoted text clipped - 42 lines]
> compilation prior to 8.2. I believe it is on of the Application Development
> Guides. Of course, if you go to 8.2 you don't need the C compiler.
Knut Stolze - 28 Sep 2006 07:34 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> entry point can not be found", in some place, say sqlasetdata.) If I
> upgrade db2 on Windows to the same Fixpak, it works.
What's the exact error message?
How does your application access DB2? (CLI, embedded SQL, ...)
Have you checked the APAR list that there was no fix merged into FP12 that
may relate to your problem?

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
gjiang_usenet@yahoo.com - 28 Sep 2006 15:24 GMT
The exact error message is:
The procedure entry point sqlasetdata@24 could not be located in the
dynamic link library DB2APP.DLL
Thanks,
Guoping
> > Hi,
> >
[quoted text clipped - 15 lines]
> DB2 Information Integration Development
> IBM Germany
Knut Stolze - 28 Sep 2006 17:12 GMT
> The exact error message is:
>
> The procedure entry point sqlasetdata@24 could not be located in the
> dynamic link library DB2APP.DLL
That doesn't look like a DB2 error message. So you should try to figure out
what your application is actually doing.
Also, what about the other questions?
>> What's the exact error message?
>> How does your application access DB2? (CLI, embedded SQL, ...)
>> Have you checked the APAR list that there was no fix merged into FP12
>> that may relate to your problem?

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
Frank Swarbrick - 28 Sep 2006 23:50 GMT
My guess is its related to the issue described here:
http://www-1.ibm.com/support/docview.wss?uid=swg21181887
>>> <gjiang_usenet@yahoo.com> 09/28/06 8:24 AM >>>
The exact error message is:
The procedure entry point sqlasetdata@24 could not be located in the
dynamic link library DB2APP.DLL
gjiang_usenet@yahoo.com - 28 Sep 2006 18:23 GMT
I forgot to mention that only a small and simple portion of the
application accesses DB2 via embeded SQL.
> > Hi,
> >
[quoted text clipped - 15 lines]
> DB2 Information Integration Development
> IBM Germany
Phil Sherman - 28 Sep 2006 18:58 GMT
This looks like you are using a header file that references an entry
point that has existed for a while in the *ix environment but has just
recently been added to the Windows environment. This will cause exactly
the problem you're encountering.
Phil Sherman
> Hi,
>
[quoted text clipped - 33 lines]
>
> Guoping