Author Topic: dll-load problem with executable created by codeblocks IDE  (Read 4155 times)

rippianer

  • Guest
dll-load problem with executable created by codeblocks IDE
« on: February 02, 2007, 05:26:20 pm »
Hi,
I built a program under MinGW which is linked against the Oracle-libraries (oci.dll).
For this purpose I created an import-lib liboci.a from oci.dll and linked against this import-lib.
I could run the program under MinGW successful.

Now I created this program from within CB (same defines, compiler options..., linked
against same libs as under pure MinGW).
When I start the executable created by CB it fails to connect to the Oracle-database,
because the OCI-Interface is not properly initialized (a call to a method otl_initialize fails
and as a result I can not connect to an Oracle database).

I looked with the "dependency walker program"  inside both EXEs and the static dependencies
were the same for both EXEs(MinGW and CB).

I started to run both EXEs inside "dependency walker program" and I saw that the
"pure MinGW Executable" loads oci.dll and OraOCIEI10.dll but "CB Executable" does not.
You can see both traces here:

http://www.randspringer.de/tora/tora.txt     (OK, pure MinGW)
http://www.randspringer.de/tora/cb-tora.txt  (Oracle initialize error,
                                              Codeblocks EXE)

The PATH variable is the same for both EXEs (I started both from within the same directory
in the same MSYS terminal).

Can someone explain why the dll is loaded in MinGW-EXE and not in CB-EXE ?

I'm a newbie to CB, I used a CB version from a nightly snapshot some days ago.

Thomas


Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: dll-load problem with executable created by codeblocks IDE
« Reply #1 on: February 02, 2007, 06:04:45 pm »
1. Change the "Compiler logging" method on the "Other" tab of your Global compiler settings to "Full command line".
2. Find the differences between the command line C::B uses and the command line you use.
3. ...
4. Profit!
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

rippianer

  • Guest
Re: dll-load problem with executable created by codeblocks IDE
« Reply #2 on: February 02, 2007, 07:20:52 pm »
My link line under MinGW looks like:
mingw32-g++ "-L/c/qtwin/lib" "-Llib" -O2 -mwindows -o tora objs/toabout.o <other objects>
...
 -lwsock32 -lqt-mt -loci -lstdc++ -lqscintilla

in CB it looks like:

mingw32-g++.exe  -o bin\Debug\CB-TOra.exe obj\Debug\toprofiler.o <other objects>
-LC:\qtwin\lib -LC:\tora\tora-1.3.22svn\src\lib -O2 -mwindows  C:\MinGW\lib\libwsock32.a C:\qtwin\lib\libqt-mt.a C:\tora\tora-1.3.22svn\src\lib\liboci.a C:\MinGW\lib\libstdc++.a C:\qtwin\lib\libqscintilla.a

I thought the commands are equivalent ?!

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: dll-load problem with executable created by codeblocks IDE
« Reply #3 on: February 02, 2007, 09:19:32 pm »
They appear to be equivalent to me, as well. What I'm suggesting you do to resolve the problem is start with a command line that works, and guadually migrate it toward the command line that Code::Blocks runs until it doesn't work. At that point you'll know how to solve the problem, and can provide a bug report on C::B if appropriate. In the end, however, all C::B does is assist in generating the appropriate compiler commands.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

rippianer

  • Guest
Re: dll-load problem with executable created by codeblocks IDE
« Reply #4 on: February 03, 2007, 01:47:29 pm »
Hi,
problem solved. I my CB-project there was a source file included, which prevented that oci.dll
was called. After I removed the file from the project all was fine.