getcwd() segmentation fault Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ioki9
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Mar 09, 2021 5:25 pm

getcwd() segmentation fault

Post by ioki9 »

hey, i have application that is running perfectly fine on windows, but when it try to build and launch it on linux(ubntu 21.04) i get segmentantion fault on getcwd function.wxWidgets version 3.1.4 is built as static with unicode, would appreciate any help.
Screenshot from 2021-11-25 14-36-50.png
Screenshot from 2021-11-25 14-37-04.png
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: getcwd() segmentation fault

Post by doublemax »

Most likely this call get executed before wxWidgets is initialized, because you're using it to initialize a global variable.

Move the respective code to wxApp::OnInit()
Use the source, Luke!
ioki9
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Mar 09, 2021 5:25 pm

Re: getcwd() segmentation fault

Post by ioki9 »

doublemax wrote: Thu Nov 25, 2021 11:48 am Most likely this call get executed before wxWidgets is initialized, because you're using it to initialize a global variable.

Move the respective code to wxApp::OnInit()
it worked, thanks for help!
Post Reply