wxGTK: Absurd wxWidgets version conflict

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
acsMike
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Feb 11, 2005 9:05 am
Location: Stockholm, Sweden

wxGTK: Absurd wxWidgets version conflict

Post by acsMike » Mon Oct 13, 2008 8:39 am

Hi,
For certain reasons we have a project consisting of the following odd mix:

* A wxGTK 2.8 based app using dynamically loaded wx-libraries.
* A wxGTK 2.6.3 based shared library (*.so) with statically linked wx-libraries.

The app loads the shared library using a standard mechanism. The problem occurs rather quickly as the library (using wxGTK 2.6.3) starts using the library functions of the app (wxGTK 2.8 ). Naturally, the mismatch makes everything goes down.

In particular, it is the static member wxAppConsole::CheckBuildOptions inside the app, that is called from the library.

Have I misunderstood of shared objects are linked at link time? I was under the impression that only my own members would be called. I mean, I already got them in the library.

Thanks for any insight you might have!
/Michael Ljunggren, developer
Peavey Electronics

Windows: 2.6.3, 2.8.9 (VS2005) ** Mac: 2.6.3 (XCode 3) ** WinCE: 2.8.9 (VS2005), ** GTK: 2.8.9 (Kdevelop)

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4529
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Post by ONEEYEMAN » Fri Oct 24, 2008 8:31 pm

Hi,
First and most obvious: why not upgrade 2.6.x to 2.8.x?
Second, how did you compile 2.8.x?
Third, can you post the results of "bt"?

Thank you.

acsMike
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Feb 11, 2005 9:05 am
Location: Stockholm, Sweden

Post by acsMike » Fri Oct 24, 2008 8:56 pm

ONEEYEMAN wrote:Hi,
First and most obvious: why not upgrade 2.6.x to 2.8.x?
I don't think that is obvious. One of the binaries is a plug-in to the other, and as soon as one of them is build by a another vendor, the problem becomes critical. Besides, it's a OS related problem I guess?
ONEEYEMAN wrote: Second, how did you compile 2.8.x?
The 2.8 was dynamically linked, i.e the stock installation.

ONEEYEMAN wrote: Third, can you post the results of "bt"?
The what?

Thanks man.
/Michael Ljunggren, developer
Peavey Electronics

Windows: 2.6.3, 2.8.9 (VS2005) ** Mac: 2.6.3 (XCode 3) ** WinCE: 2.8.9 (VS2005), ** GTK: 2.8.9 (Kdevelop)

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4529
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Post by ONEEYEMAN » Fri Oct 24, 2008 9:11 pm

Hi,
acsMike wrote:
ONEEYEMAN wrote: Hi,
First and most obvious: why not upgrade 2.6.x to 2.8.x?
I don't think that is obvious. One of the binaries is a plug-in to the other, and as soon as one of them is build by a another vendor, the problem becomes critical. Besides, it's a OS related problem I guess?
I am not sure what you mean. All you need to do is recompile with 2.8 whatever you compiled with 2.6.
acsMike wrote:
ONEEYEMAN wrote: Second, how did you compile 2.8.x?
The 2.8 was dynamically linked, i.e the stock installation.
No, I guess you misunderstood. What "configure" options did you pass to wx itself. Specifically, I'm looking for the one that says "--enable-compat26"...
acsMike wrote:
ONEEYEMAN wrote: Third, can you post the results of "bt"?
The what?
You work with wxGTK (Linux?), which means you should use "backtrace" command in gdb, which refers to as "bt". :)
acsMike wrote: Thanks man.
No problem.

acsMike
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Feb 11, 2005 9:05 am
Location: Stockholm, Sweden

Post by acsMike » Sat Oct 25, 2008 8:08 am

I am not sure what you mean. All you need to do is recompile with 2.8 whatever you compiled with 2.6.
If you have ever used a Photoshop plug-in or a VST plug-in, the similarities are there. The host may choose to load or not load the plug-in. This is done using dlopen.

In a host / plug-in environment, you don't have the luxury to recompile neither the host or the plug-in because they are not a perfect match. Besides, the host may be built 5 years previously by another company. (Or vice versa...)

We do make both the host and the plug-in in this case. But the host will be used with other 3rd party plug-ins as well in the future.

Besides, the plug-ins wxWidgets 2.6 code has been patched. We need the plug-in to run it's own code, not accidentally link against outside code just because the symbols have the same name.

No, I guess you misunderstood. What "configure" options did you pass to wx itself. Specifically, I'm looking for the one that says "--enable-compat26"...
The app is running the "stock" installation of the system. The binaries have been downloaded by yum, in some cases apt-get. I.e not compiled by us.
you should use "backtrace" command in gdb
Well well, you learn something every day. I will see how it works and try posting something. Thanks!

Thanks Oneeyeman, GTK is not my main environment. I was stumped by the fact that my dynamic library wasn't using the symbols already existing in the binary, but rather outside code.
/Michael Ljunggren, developer
Peavey Electronics

Windows: 2.6.3, 2.8.9 (VS2005) ** Mac: 2.6.3 (XCode 3) ** WinCE: 2.8.9 (VS2005), ** GTK: 2.8.9 (Kdevelop)

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4529
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Post by ONEEYEMAN » Sat Oct 25, 2008 4:21 pm

Hi,
I never use a Photoshop at all, and never designed a plug-in, but I doubt something bad happen in this case. At least you can try.
Also, what happen if you compile wx by hand? All you need is to download the tarball, untar it, run "configure" and "make". All it is written in the build instruction in the readme file.

Yes you learn something new and it's amazing!!!! :)

Thank you.

DavidHart
Site Admin
Site Admin
Posts: 4008
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Sat Oct 25, 2008 5:44 pm

Hi,

Two points. First, if I understand you correctly, you have a mixture of static and dynamic libs. Just to mention that, under Linux, if both a dynamic and a static version of a lib exists, the linker will use the dynamic one.

Second, an article that you might find helpful: http://www.dwheeler.com/program-library ... TO/t1.html

Regards,

David

Post Reply