Porting a wxWidgets Application to Ubuntu

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
spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

Porting a wxWidgets Application to Ubuntu

Post by spflanze » Tue Jul 31, 2018 4:49 am

I am trying to run a wxWidgets 3.0.3 application built in Code::Blocks wxSmith running on Windows 7 on Ubuntu. I found that:
  • wxTextCtrl::SetLabel() worked in Windows 7 and does not in Ubuntu. I verified in the debugger it was passed the correct string.

    I cannot read from configuration file I was able to in Windows 7. All files in the project, including the configuration file, have Read/Write permissions for user, group, and everyone else.
Are these known problems for code developed in Windows 7 and run in Ubuntu?

User avatar
doublemax
Moderator
Moderator
Posts: 13575
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Porting a wxWidgets Application to Ubuntu

Post by doublemax » Tue Jul 31, 2018 5:01 am

wxTextCtrl::SetLabel() worked in Windows 7 and does not in Ubuntu.
SetValue() is the correct method.
I cannot read from configuration file I was able to in Windows 7. All files in the project, including the configuration file, have Read/Write permissions for user, group, and everyone else.
Please be more specific. Maybe it's related to different line endings?
Use the source, Luke!

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

Re: Porting a wxWidgets Application to Ubuntu

Post by ONEEYEMAN » Tue Jul 31, 2018 2:42 pm

Hi,
Did you rebuild the library or installed them from the repository?
Which code do you use to read/write the configuration file? Does it give any kind of error? Are you trying to read them from the shared folder or the files are on the Ubuntu machine? Are you using wxConfig to operate them?

Thank you.

spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

Re: Porting a wxWidgets Application to Ubuntu

Post by spflanze » Tue Jul 31, 2018 8:22 pm

The wxWidgets library was compiled on my machine. I tried at first to use precompiled binaries but this did not work due to many compile errors. Compiling the wxWidgets library myself on my machine solved this.

The configuration file was created by my program on a Windows 7 machine. There was data in it I do not want to enter again. So I brought into the Ubuntu on the expectation my program could also read it there.

The config file was created using the wxFileConfig class. I examined this file in the gedit word processor and all was as should be. But gedit did not show me the line termination character(s).

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

Re: Porting a wxWidgets Application to Ubuntu

Post by ONEEYEMAN » Tue Jul 31, 2018 9:50 pm

Hi,
In which directory did you put this configuration file?
How do you using the wxConfig class? Can you show some code?
Can you run gdb and see if the file is found on the system and if it can be read properly? If it was made on Windows it might be the line-ending...

Thank you.

spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

Re: Porting a wxWidgets Application to Ubuntu

Post by spflanze » Sat Aug 04, 2018 6:40 pm

The project can be downloaded from:
http://www.mediafire.com/file/cmgdv01y0 ... u.zip/file
Please read the file "wxWidgets Forum Readme.txt" for answers to questions asked about it in this thread here.

Your help with this is much appreciated.

User avatar
doublemax
Moderator
Moderator
Posts: 13575
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Porting a wxWidgets Application to Ubuntu

Post by doublemax » Sat Aug 04, 2018 7:25 pm

Have you tried if the line-endings are the problem? E.g. by just taking the non-working config file and changing the line endings in a text editor?
Use the source, Luke!

spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

Re: Porting a wxWidgets Application to Ubuntu

Post by spflanze » Sun Aug 05, 2018 12:42 am

After seeing your reply I executed the Linux command dos2unix on that configuration file. But now a new problem has made it impossible to see what difference that makes. The applicaion's window does not appear. There is no indication the applications has stopped, and the debugger keeps running until I stop it. A manifestation of this same problem may be that something is corrupting the WYSIWYG wxs file editor. At first things look normal. But when it is scrolled, and then scrolling stops, major parts of the WYSIWYG display disappear. This problem is severe enough that this editor cannot be used to edit it.

User avatar
doublemax
Moderator
Moderator
Posts: 13575
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Porting a wxWidgets Application to Ubuntu

Post by doublemax » Sun Aug 05, 2018 7:30 am

But now a new problem has made it impossible to see what difference that makes. The application's window does not appear.
Apparently it did change something.

But i'm afraid you'll have to learn how to debug under Linux. The issues are too vague as if anyone could solve this just by reading your description.
Use the source, Luke!

spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

Re: Porting a wxWidgets Application to Ubuntu

Post by spflanze » Sun Aug 05, 2018 8:00 am

The new problem was present before I ran dos2unix on that configuration file.

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

Re: Porting a wxWidgets Application to Ubuntu

Post by ONEEYEMAN » Mon Aug 06, 2018 3:03 am

Hi,
Install the gdb.
Run the program under gdb and see what is being read from the configuration file.

Thank you.

Post Reply