Page 1 of 1

Porting a wxWidgets Application to Ubuntu

Posted: Tue Jul 31, 2018 4:49 am
by spflanze
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?

Re: Porting a wxWidgets Application to Ubuntu

Posted: Tue Jul 31, 2018 5:01 am
by doublemax
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?

Re: Porting a wxWidgets Application to Ubuntu

Posted: Tue Jul 31, 2018 2:42 pm
by ONEEYEMAN
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.

Re: Porting a wxWidgets Application to Ubuntu

Posted: Tue Jul 31, 2018 8:22 pm
by spflanze
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).

Re: Porting a wxWidgets Application to Ubuntu

Posted: Tue Jul 31, 2018 9:50 pm
by ONEEYEMAN
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.

Re: Porting a wxWidgets Application to Ubuntu

Posted: Sat Aug 04, 2018 6:40 pm
by spflanze
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.

Re: Porting a wxWidgets Application to Ubuntu

Posted: Sat Aug 04, 2018 7:25 pm
by doublemax
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?

Re: Porting a wxWidgets Application to Ubuntu

Posted: Sun Aug 05, 2018 12:42 am
by spflanze
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.

Re: Porting a wxWidgets Application to Ubuntu

Posted: Sun Aug 05, 2018 7:30 am
by doublemax
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.

Re: Porting a wxWidgets Application to Ubuntu

Posted: Sun Aug 05, 2018 8:00 am
by spflanze
The new problem was present before I ran dos2unix on that configuration file.

Re: Porting a wxWidgets Application to Ubuntu

Posted: Mon Aug 06, 2018 3:03 am
by ONEEYEMAN
Hi,
Install the gdb.
Run the program under gdb and see what is being read from the configuration file.

Thank you.