comp.lang.ada
 help / color / mirror / Atom feed
* Problem with QTAda 3.0 and QTCore4.dll on Windows
@ 2010-01-05 21:04 Alexis
  2010-01-06 12:17 ` Vadim Godunko
  0 siblings, 1 reply; 14+ messages in thread
From: Alexis @ 2010-01-05 21:04 UTC (permalink / raw)


Hi,

I need a bit of help. I'm trying to use QTAda on a Windows 7 with GNAt
GPL 2009, but there seems to be a problem linking with QTCore4.dll, I
get a message saying:

The procedure entry point _Z11qt_assert_xPKcS0_i could not be located
in the dynamic link library QtCore4.dll

I'm using GNAT GPL 2009 and QTada 3.0. I have installed the QT 4.6.0
software package for VS2008, I have set the c:\Qt\4.6.0\bin path as
the first path, but it doesn't work with QTAda programs, though all
VS2008 C++ programs work fine.

I have then downloaded two binary QTcore4.dll and QTGui4.dll version
4.5.2 I found somewhere in the web and put them in the path instead of
QT 4.6.0, then the QTAda programs work.

I have then downloaded the source code for QT 4.5.1 and compiled it
and put that in the path as I thought that maybe the problem was that
QT 4.6.0 was not supported, now the QTAda programs don't work.

For some strange reason the QTAda programs I compile work fine with
the binary QTcore4.dll ver. 4.5.2, but not with the original 4.6.0 nor
my own compiled 4.5.1.

Does any of this make sense to you?

Many thanks and best regards.
Alexis.



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-05 21:04 Problem with QTAda 3.0 and QTCore4.dll on Windows Alexis
@ 2010-01-06 12:17 ` Vadim Godunko
  2010-01-06 14:15   ` Hibou57 (Yannick Duchêne)
  2010-01-06 22:23   ` Alexis
  0 siblings, 2 replies; 14+ messages in thread
From: Vadim Godunko @ 2010-01-06 12:17 UTC (permalink / raw)


On Jan 6, 12:04 am, Alexis <jose_alexis_paez_thurg...@hotmail.com>
wrote:
>
> I'm using GNAT GPL 2009 and QTada 3.0. I have installed the QT 4.6.0
> software package for VS2008, I have set the c:\Qt\4.6.0\bin path as
> the first path, but it doesn't work with QTAda programs, though all
> VS2008 C++ programs work fine.
>
QtAda can't be used with MSVC for technical reasons. You need to use
prebuild Qt for MinGW port of build Qt by hands using GCC 4.4 compiler
or G++ compiler from GNAT GPL 2009. You also can use prebuild QtAda
3.1 snapshot for Qt 4.6.0/MinGW.



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-06 12:17 ` Vadim Godunko
@ 2010-01-06 14:15   ` Hibou57 (Yannick Duchêne)
  2010-01-06 14:46     ` Dmitry A. Kazakov
  2010-01-06 22:23   ` Alexis
  1 sibling, 1 reply; 14+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2010-01-06 14:15 UTC (permalink / raw)


On 6 jan, 13:17, Vadim Godunko <vgodu...@gmail.com> wrote:
> QtAda can't be used with MSVC for technical reasons.
What are these reasons please ? (if it does not requires too much to
say).
I'm not using Qt, I just wanted to know



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-06 14:15   ` Hibou57 (Yannick Duchêne)
@ 2010-01-06 14:46     ` Dmitry A. Kazakov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry A. Kazakov @ 2010-01-06 14:46 UTC (permalink / raw)


On Wed, 6 Jan 2010 06:15:59 -0800 (PST), Hibou57 (Yannick Duch�ne) wrote:

> On 6 jan, 13:17, Vadim Godunko <vgodu...@gmail.com> wrote:
>> QtAda can't be used with MSVC for technical reasons.
> What are these reasons please ? (if it does not requires too much to
> say).

Whatever they are, that can be fixed, but you certainly wouldn't enjoy the
horrific manifest stuff required in order to link to the MSVC run-time.

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



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-06 12:17 ` Vadim Godunko
  2010-01-06 14:15   ` Hibou57 (Yannick Duchêne)
@ 2010-01-06 22:23   ` Alexis
  2010-01-07  7:19     ` Per Sandberg
  1 sibling, 1 reply; 14+ messages in thread
From: Alexis @ 2010-01-06 22:23 UTC (permalink / raw)


On 6 ene, 13:17, Vadim Godunko <vgodu...@gmail.com> wrote:
> On Jan 6, 12:04 am, Alexis <jose_alexis_paez_thurg...@hotmail.com>
> wrote:
>
> > I'm using GNAT GPL 2009 and QTada 3.0. I have installed the QT 4.6.0
> > software package for VS2008, I have set the c:\Qt\4.6.0\bin path as
> > the first path, but it doesn't work with QTAda programs, though all
> > VS2008 C++ programs work fine.
>
> QtAda can't be used with MSVC for technical reasons. You need to use
> prebuild Qt for MinGW port of build Qt by hands using GCC 4.4 compiler
> or G++ compiler from GNAT GPL 2009. You also can use prebuild QtAda
> 3.1 snapshot for Qt 4.6.0/MinGW.

Hi,

Thanks for your help. I'm quite new to QT so I'm not familiar with
some things. Do you mean that QtAda doesn't work with the Qt Windows
libraries for MSVC? Only MinGW? What's the reason for this?

Many thanks and best regards!
Alexis.




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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-06 22:23   ` Alexis
@ 2010-01-07  7:19     ` Per Sandberg
  2010-01-07 10:59       ` Dmitry A. Kazakov
  0 siblings, 1 reply; 14+ messages in thread
From: Per Sandberg @ 2010-01-07  7:19 UTC (permalink / raw)


The core reason is that the Binary Interface specific the name-mangling 
in C++ is different between gcc and MSVC, on top of that the 
documentation in the MSVC case is "sparse".
Then you will end up with two runtimes for C++, and to run MSVC and 
GCC(g++) in parallel requires a very consistent way of doing things 
since among all other things ther will be two different heaps...

/Per


2010-01-06 23:23, Alexis skrev:
> On 6 ene, 13:17, Vadim Godunko<vgodu...@gmail.com>  wrote:
>> On Jan 6, 12:04 am, Alexis<jose_alexis_paez_thurg...@hotmail.com>
>> wrote:
>>
>>> I'm using GNAT GPL 2009 and QTada 3.0. I have installed the QT 4.6.0
>>> software package for VS2008, I have set the c:\Qt\4.6.0\bin path as
>>> the first path, but it doesn't work with QTAda programs, though all
>>> VS2008 C++ programs work fine.
>>
>> QtAda can't be used with MSVC for technical reasons. You need to use
>> prebuild Qt for MinGW port of build Qt by hands using GCC 4.4 compiler
>> or G++ compiler from GNAT GPL 2009. You also can use prebuild QtAda
>> 3.1 snapshot for Qt 4.6.0/MinGW.
>
> Hi,
>
> Thanks for your help. I'm quite new to QT so I'm not familiar with
> some things. Do you mean that QtAda doesn't work with the Qt Windows
> libraries for MSVC? Only MinGW? What's the reason for this?
>
> Many thanks and best regards!
> Alexis.
>



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-07  7:19     ` Per Sandberg
@ 2010-01-07 10:59       ` Dmitry A. Kazakov
  2010-01-07 21:39         ` Alexis
  2010-01-07 22:11         ` Vadim Godunko
  0 siblings, 2 replies; 14+ messages in thread
From: Dmitry A. Kazakov @ 2010-01-07 10:59 UTC (permalink / raw)


On Thu, 07 Jan 2010 08:19:17 +0100, Per Sandberg wrote:

> The core reason is that the Binary Interface specific the name-mangling 
> in C++ is different between gcc and MSVC, on top of that the 
> documentation in the MSVC case is "sparse".

That should not be a problem in case of C. One should only make a choice
between stdcall and cdecl convention when you make a call from Ada. I guess
Qt has plain C interface? Then what happens inside of it is no matter.

> Then you will end up with two runtimes for C++, and to run MSVC and 
> GCC(g++) in parallel requires a very consistent way of doing things 
> since among all other things ther will be two different heaps...

Actually I used such combinations in other cases (not Qt), e.g. GNAT Ada
run-time + MSVC (sometimes with MFT!) + some bunch of third party libraries
of unknown language and origin.

The key issue is to set proper compiler/linker options for the MSVC
project. Which is FAR from being trivial. Another huge issue is deployment,
with MS manifests (due to broken implementations of) you simply cannot tell
if linked code will or will not work on another computer.

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



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-07 10:59       ` Dmitry A. Kazakov
@ 2010-01-07 21:39         ` Alexis
  2010-01-07 22:11         ` Vadim Godunko
  1 sibling, 0 replies; 14+ messages in thread
From: Alexis @ 2010-01-07 21:39 UTC (permalink / raw)


On 7 ene, 11:59, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On Thu, 07 Jan 2010 08:19:17 +0100, Per Sandberg wrote:
> > The core reason is that the Binary Interface specific the name-mangling
> > in C++ is different between gcc and MSVC, on top of that the
> > documentation in the MSVC case is "sparse".
>
> That should not be a problem in case of C. One should only make a choice
> between stdcall and cdecl convention when you make a call from Ada. I guess
> Qt has plain C interface? Then what happens inside of it is no matter.
>
> > Then you will end up with two runtimes for C++, and to run MSVC and
> > GCC(g++) in parallel requires a very consistent way of doing things
> > since among all other things ther will be two different heaps...
>
> Actually I used such combinations in other cases (not Qt), e.g. GNAT Ada
> run-time + MSVC (sometimes with MFT!) + some bunch of third party libraries
> of unknown language and origin.
>
> The key issue is to set proper compiler/linker options for the MSVC
> project. Which is FAR from being trivial. Another huge issue is deployment,
> with MS manifests (due to broken implementations of) you simply cannot tell
> if linked code will or will not work on another computer.
>
> --
> Regards,
> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de

Thanks a lot to all of you, your advice has been very helpful. I have
now installed QT 4.5.1 MinGW on my machine and the QtAda programs work
fine, which is what I wanted.

I don't remember seeing any mention of this fact on the QtAda website,
it might be something interesting to add a note on this.

May thanks!
Best regards, Alexis.



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-07 10:59       ` Dmitry A. Kazakov
  2010-01-07 21:39         ` Alexis
@ 2010-01-07 22:11         ` Vadim Godunko
  2010-01-07 22:32           ` Hibou57 (Yannick Duchêne)
  2010-01-07 23:02           ` Dmitry A. Kazakov
  1 sibling, 2 replies; 14+ messages in thread
From: Vadim Godunko @ 2010-01-07 22:11 UTC (permalink / raw)


On Jan 7, 1:59 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On Thu, 07 Jan 2010 08:19:17 +0100, Per Sandberg wrote:
> > The core reason is that the Binary Interface specific the name-mangling
> > in C++ is different between gcc and MSVC, on top of that the
> > documentation in the MSVC case is "sparse".
>
> That should not be a problem in case of C. One should only make a choice
> between stdcall and cdecl convention when you make a call from Ada. I guess
> Qt has plain C interface? Then what happens inside of it is no matter.
>
Qt is pure C++ library, there is no C interface provided by it.

> > Then you will end up with two runtimes for C++, and to run MSVC and
> > GCC(g++) in parallel requires a very consistent way of doing things
> > since among all other things ther will be two different heaps...
>
> Actually I used such combinations in other cases (not Qt), e.g. GNAT Ada
> run-time + MSVC (sometimes with MFT!) + some bunch of third party libraries
> of unknown language and origin.
>
> The key issue is to set proper compiler/linker options for the MSVC
> project. Which is FAR from being trivial. Another huge issue is deployment,
> with MS manifests (due to broken implementations of) you simply cannot tell
> if linked code will or will not work on another computer.
>
QtAda's code includes both C/C++ and Ada code which refers to each
others in both directions, so it is unpractical to separate it into
two independent shared libraries to build C/C++ part using MSVC and
Ada part using GNAT; but mixing of MSVC and GNAT object files in the
same shared library is not supported now.



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-07 22:11         ` Vadim Godunko
@ 2010-01-07 22:32           ` Hibou57 (Yannick Duchêne)
  2010-01-08  7:10             ` Vadim Godunko
  2010-01-07 23:02           ` Dmitry A. Kazakov
  1 sibling, 1 reply; 14+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2010-01-07 22:32 UTC (permalink / raw)


On 7 jan, 23:11, Vadim Godunko <vgodu...@gmail.com> wrote:
> Qt is pure C++ library, there is no C interface provided by it.
While I do not know about the technical details, I use to read from
place to place, GNAT provides a custom support for interfacing Ada and
C++ library, as well as ObjectAda does, if I'm not wrong.

Otherwise, to have an easier C “ interfacable ” library in the same
area, GTK is a good option.

Honestly, I do not like so called “ portable ” UIs (personal feeling
with reasons), but although I do not really enjoy it, it seems to me
GTK is easier to use than Qt (and more lightweight in most of case).

Sorry if I ever hurt someones with my comments on the subject (not Ada
related, sorry about it too).



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-07 22:11         ` Vadim Godunko
  2010-01-07 22:32           ` Hibou57 (Yannick Duchêne)
@ 2010-01-07 23:02           ` Dmitry A. Kazakov
  2010-01-08  7:28             ` Vadim Godunko
  1 sibling, 1 reply; 14+ messages in thread
From: Dmitry A. Kazakov @ 2010-01-07 23:02 UTC (permalink / raw)


On Thu, 7 Jan 2010 14:11:37 -0800 (PST), Vadim Godunko wrote:

> On Jan 7, 1:59�pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>> On Thu, 07 Jan 2010 08:19:17 +0100, Per Sandberg wrote:
>>> The core reason is that the Binary Interface specific the name-mangling
>>> in C++ is different between gcc and MSVC, on top of that the
>>> documentation in the MSVC case is "sparse".
>>
>> That should not be a problem in case of C. One should only make a choice
>> between stdcall and cdecl convention when you make a call from Ada. I guess
>> Qt has plain C interface? Then what happens inside of it is no matter.
>>
> Qt is pure C++ library, there is no C interface provided by it.

Well, the question is whether the interface uses virtual functions and
classes you have to derive from. That would make a real difference.

> QtAda's code includes both C/C++ and Ada code which refers to each
> others in both directions, so it is unpractical to separate it into
> two independent shared libraries to build C/C++ part using MSVC and
> Ada part using GNAT; but mixing of MSVC and GNAT object files in the
> same shared library is not supported now.

I agree. It is the Visual Studio's debugger, which makes MSVC attractive.
Since that won't work with GNAT, there seems to be no reason left to port
Qt into MSVC.

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



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-07 22:32           ` Hibou57 (Yannick Duchêne)
@ 2010-01-08  7:10             ` Vadim Godunko
  2010-01-08  9:41               ` Dmitry A. Kazakov
  0 siblings, 1 reply; 14+ messages in thread
From: Vadim Godunko @ 2010-01-08  7:10 UTC (permalink / raw)


On Jan 8, 1:32 am, Hibou57 (Yannick Duchêne)
<yannick_duch...@yahoo.fr> wrote:
>
> While I do not know about the technical details, I use to read from
> place to place, GNAT provides a custom support for interfacing Ada and
> C++ library, as well as ObjectAda does, if I'm not wrong.
>
GNAT C++ interface feature is expected to be used only with C++ code
compiled by G++. Don't known about ObjectAda, may be it can interface
with MSVC.

> Honestly, I do not like so called “ portable ” UIs (personal feeling
> with reasons), but although I do not really enjoy it, it seems to me
> GTK is easier to use than Qt (and more lightweight in most of case).
>
Because I am one of authors of QtAda, I let others to compare GtkAda
and QtAda. :-)



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-07 23:02           ` Dmitry A. Kazakov
@ 2010-01-08  7:28             ` Vadim Godunko
  0 siblings, 0 replies; 14+ messages in thread
From: Vadim Godunko @ 2010-01-08  7:28 UTC (permalink / raw)


On Jan 8, 2:02 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On Thu, 7 Jan 2010 14:11:37 -0800 (PST), Vadim Godunko wrote:
> > On Jan 7, 1:59 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> > wrote:
> >> On Thu, 07 Jan 2010 08:19:17 +0100, Per Sandberg wrote:
> >>> The core reason is that the Binary Interface specific the name-mangling
> >>> in C++ is different between gcc and MSVC, on top of that the
> >>> documentation in the MSVC case is "sparse".
>
> >> That should not be a problem in case of C. One should only make a choice
> >> between stdcall and cdecl convention when you make a call from Ada. I guess
> >> Qt has plain C interface? Then what happens inside of it is no matter.
>
> > Qt is pure C++ library, there is no C interface provided by it.
>
> Well, the question is whether the interface uses virtual functions and
> classes you have to derive from. That would make a real difference.
>
Both are expected to be used actively. The most complicated area of
QtAda design was providing a useful (for the end programmer) way to
interfacing with virtual functions and handling association between
the same object at Ada and C++ side.



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

* Re: Problem with QTAda 3.0 and QTCore4.dll on Windows
  2010-01-08  7:10             ` Vadim Godunko
@ 2010-01-08  9:41               ` Dmitry A. Kazakov
  0 siblings, 0 replies; 14+ messages in thread
From: Dmitry A. Kazakov @ 2010-01-08  9:41 UTC (permalink / raw)


On Thu, 7 Jan 2010 23:10:25 -0800 (PST), Vadim Godunko wrote:

> On Jan 8, 1:32�am, Hibou57 (Yannick Duch�ne)
> <yannick_duch...@yahoo.fr> wrote:
>>
>> While I do not know about the technical details, I use to read from
>> place to place, GNAT provides a custom support for interfacing Ada and
>> C++ library, as well as ObjectAda does, if I'm not wrong.
>>
> GNAT C++ interface feature is expected to be used only with C++ code
> compiled by G++. Don't known about ObjectAda, may be it can interface
> with MSVC.

You can even debug programs compiled by ObjectAda (7.2) in Visual Studio, 
to a certain extent. However, I cannot tell if ObjectAda C++ interfacing 
works, I never tried that.

To be honest, it is a big mistake to make a library with only C++ 
interface, because that exposes not only the constants, subprograms and 
their profiles defined in terms of simple types, but it also does virtual 
tables and internal layouts of the classes. That is too much coupling from 
the software design point of view. (The same would apply to Ada's tagged 
types, unfortunately.)

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



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

end of thread, other threads:[~2010-01-08  9:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-05 21:04 Problem with QTAda 3.0 and QTCore4.dll on Windows Alexis
2010-01-06 12:17 ` Vadim Godunko
2010-01-06 14:15   ` Hibou57 (Yannick Duchêne)
2010-01-06 14:46     ` Dmitry A. Kazakov
2010-01-06 22:23   ` Alexis
2010-01-07  7:19     ` Per Sandberg
2010-01-07 10:59       ` Dmitry A. Kazakov
2010-01-07 21:39         ` Alexis
2010-01-07 22:11         ` Vadim Godunko
2010-01-07 22:32           ` Hibou57 (Yannick Duchêne)
2010-01-08  7:10             ` Vadim Godunko
2010-01-08  9:41               ` Dmitry A. Kazakov
2010-01-07 23:02           ` Dmitry A. Kazakov
2010-01-08  7:28             ` Vadim Godunko

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