Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SegFault while doing the linux tutorial on the Ubuntu subsystem in windows 10  (Read 1620 times)

0 Members and 1 Guest are viewing this topic.

nighthawk475

  • Newbie
  • *
  • Posts: 1
    • View Profile
This is sort of a two part question as I think I have a partial answer to the first half...

First though I'll explain that I'm using the new window10 feature, the linux subsystem which allows you to run a version of Bash / Ubuntu inside windows 10.

I have followed the entire linux tutorial, and I've gotten it to properly compile and link my simple program (just the main.cpp program found here:  http://www.sfml-dev.org/tutorials/2.4/start-linux.php )

However when I run the application at the end it just immediately prints "Segmentation Fault (core dumped)" and exits. So first question is what did I do wrong from the tutorial?
-the .cpp file is literally copy pasted from the website (I've deleted and recreated it multiple times, the first two times I typed it by hand / paraphrased, these last few it's been copy/pasted, I don't think I made any mistakes in copying it) I'll upload the file for viewing if something thinks they need to see it though
-I have "-Wall" flag on while compiling and while linking as well, it's showing me no warnings so I can't figure out why the end file doesn't run.
-I've run ldd on the executable and it seems to be correctly linked to the sfml libraries (it was suggested to me by another friend that I try copying the libraries into the same folder as the executable, I've tried copying in the .so files (and .so.2 files separately) and it didn't work. (ldd output here for those interested: http://pastebin.com/68dLDnQF ; this just shows that the file should be correctly finding all libraries on it's own when run)


Soo part two...
My guess is that this is an issue that comes from running linux inside windows. I assume that though I'm effectively running a live version of Ubuntu, when I start a new process in bash it's starting a new process in my windows as well or something like that, and I need to compile with the target operating system being windows instead of linux and use the windows .dll libraries?

I'm curious if I can fix this by using the windows natives and compiling with those and then running the program, perhaps running it through windows's command prompt if need be?
I would really like to keep deving through bash though and I'm not sure how to go about a few things for trying to see if this works instead.
I don't know how to correctly get and then compile with the window native versions of sfml while staying in bash, and is there a way to point to those at compile time as what should be used.

and follow up to part two, if I want to compile my program to run on two different target operating systems, do I need to compile multiple times with different library files, or can I just take my windows version and move it to  folder with .so libraries and run it in linux (normally) ?    (I'm not used to using external libraries while programming, sorry if this is simple)



I hope this makes sense, feel free to ask me anything else or for me to share output, thank you for any help.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
SegFault while doing the linux tutorial on the Ubuntu subsystem in windows 10
« Reply #1 on: December 27, 2016, 09:15:05 am »
We have currently no support for the Linux subsystem on Ubuntu. It'svuncertain whether it's possible to even use all the low level APIs as SFML does.

If you have the time and experience, we'd certainly be interested in hearing what adjustments need to be made.

As for your crash, create a debug build and run it in gdb to get a stack trace.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/