DSHack

Archive Generated December 23rd, 2018
�?Tutorial】Compiling GTK+ Apps on Windows 10
Author Posted on 2017/01/08
#2825
MKGirlism In the first place, I was hoping this wasn't necessary, but unfortunately for me, it turned out I need to write this tutorial more than wanted.
Here we go.

Note
In order to use this tutorial, you must have Windows 10, with the Anniversary Update installed, or newer.
Windows 10 without that Update, or any older Windows version, won't work.

1. Enable Linux Subsystem
Go to the Settings App → Update & 'Security' → For developers.
Enable Developer mode.


Now search for "Windows Features" in that enormous search-kind of thing.


Now enable "Windows Subsystem for Linux (Beta)", click "OK", and reboot when asked for it.


2. Update bash, and install the necessary tools
Now in that crazy search box, look for "bash", run that.
It'll set itself up, when running it for the first time.
Just follow the instructions you see there.

Also, when you need to insert your password, you will notice you don't see anything happening.
That's okay, you are typing your password at the moment, you just won't see anything appearing for security reasons.

Now run this command:
sudo apt-get update

Then:
sudo apt-get upgrade

Now:
sudo apt-get install gcc git gtk+-2.0

3. Install X11 Server
Now download and install Xming.
In the Installer, just agree with all the default settings.

4. Compile and run
Before we proceed, let's make it ourselves easier, and run this:
cd

Now we can finally compile and run stuff!
Download the source, for example, of my KCL Calculator.
git clone https://github.com/MKGirlism/KCL-Calculator.git

Get into this directory:
cd KCL-Calculator

Execute the command I've included in the README file:
gcc -o kclcalc *.c `pkg-config --libs --cflags gtk+-2.0`
Just ignore the warnings.

Once done, run it with:
DISPLAY=:0 ./kclcalc

It works!
Author Posted on 2017/01/16
#2854
Rover Hey umm. I got the Ubuntu to work. (Thanks a lot ^^) But...I dont even know what to do on part 4...
Can you tell me how to do part 4 word for word?

(Edit: do you mean type in CD in Ubuntu?)
Author Posted on 2017/01/16
#2855
MKGirlism Yes, all commands shown should be followed in the Bash window (Ubuntu, like you call it).
Author Posted on 2017/01/16
#2856
Rover Also one more thing...How to go i to a directory?
Author Posted on 2017/01/16
#2857
MKGirlism Using the "cd" command.
Because "cd" literally means "change directory".

For example:
cd /var/log

This will get you to the "/var/log" path.
Author Posted on 2017/01/16
#2858
Rover Oooh! Hehe i feel dumb now x3 Thanks for the help btw!



Edit: I keep getting this no such file or directory...Any tips how to fix that?
Author Posted on 2017/12/23
#3664
Bri I get a warning saying, "Turning on developer mode could harm your device." Do I still run it?
Author Posted on 2017/12/23
#3665
Kitty Remilya Ambiance You still can turn it on. Click "Yes" on the confirmation. You'll be safe, despite what the message says.
Author Posted on 2017/12/23
#3666
テクニカル諏訪子 It's a warning message they have to show to prevent from getting sued over errors users unknowingly make.
But as with everything (with or without developer mode), the rule of thumb is to think twice before you run any app, script, macro, etc. you get from the internet.
Author Posted on 2017/12/23
#3667
Bri Luckily, I got the first part. However, when I try to run the command: sudo apt-get update, it will say sudo is not a command.
Author Posted on 2017/12/23
#3668
テクニカル諏訪子 Could you try just "apt-get update" instead?
"sudo" is a command you have to use on Linux or a Unix-based OS in order to perform commands that affect the whole system instead of just your own user and group.
Updating all the software is something that affects the whole system, and Microsoft likely stripped that one away to make things 'easier'.
Author Posted on 2017/12/23
#3669
Bri Ok, I used the command 'apt-get update', and apt-get is not a command.
Author Posted on 2017/12/23
#3670
テクニカル諏訪子 I think I know what's going on.
But before I give you the answer, could you provide me a screenshot of where it goes wrong?
Either the error about "sudo" or "apt-get", either way is fine.
Author Posted on 2017/12/23
#3671
Bri https://cdn.discordapp.com/attachments/343501709697613824/394217978905886721/2017-12-23_1.png
Author Posted on 2017/12/23
#3672
テクニカル諏訪子 Could you upload your screenshot here?
Clicking that link gives me an access denied error in XML formatting.
Author Posted on 2017/12/23
#3673
Bri Ok. Right now I’m not on my computer, probably upload it. Somehow I don’t know how to upload it.
Author Posted on 2017/12/23
#3674
テクニカル諏訪子 When you're on a full computer, there's a "select file" button beneath the already uploaded images.
The way it works is very old school, shouldn't be too complicated.

Any other file hosting works too.
Author Posted on 2017/12/23
#3676
Bri https://i.imgur.com/bOJjung.png
Author Posted on 2017/12/23
#3677
テクニカル諏訪子 OK, so it's just like I thought you would do.

To explain it a little bit, "sudo" is a command that can only be used on Unix-based and Unix-like systems, and "apt-get" is a Debian/Ubuntu-specific package manager.
Windows 10 on the other hand is a Windows NT-based system.
To bridge this gap a bit, Microsoft has introduced a Linux subsystem in Windows 10.

However, you can't run the Linux commands directly in CMD, you will need to run Bash instead.
To do that, you either need to launch "bash" as suggested in the initial post, or you can type "bash" in CMD (can't confirm whether this one will work or not, I don't have a Windows-based PC).
Author Posted on 2017/12/24
#3678
Bri I got the KCL-Calculator to work a couple of times. Now it says 'cannot open display.'
Author Posted on 2017/12/24
#3679
テクニカル諏訪子 Don't forget to add "DISPLAY=:0" in front of the app.
Author Posted on 2017/12/24
#3680
Bri "DISPLAY=:0" is in front of the app, but all I get is this: https://i.imgur.com/VyRUxHP.png

Any ideas?
Author Posted on 2017/12/24
#3681
テクニカル諏訪子 Then in that case, I don't know what's going on.
I use Linux as my only OS, and I'm currently not home so I can't just test it for the moment.