Create a linux executable file using windows ???

Linux specific forum
Flastick
New User
New User
Posts: 6
Joined: Mon Feb 11, 2008 11:53 pm

Create a linux executable file using windows ???

Post by Flastick »

Hey all !

I made a server in pb. And it is going to be executed on linux, so I have to compile it into linux executable format .

And the problem is, I don't know how to do that in linux and I don't have hours to spend trying to do it.

So I was wondering if there is a way to compile it into linux from windows OS ? (kind of..simulation) And if there is, how to do ?!?

(In my server I only use createfile/deletefile, linkedlists, and of course networking functions. No graphical interface, no messagerequester,...)


One more question : is that all right under linux :

createfile(0, "myfile.txt")

Or should I write

createfile(0,"/ThePathWhereMyExecutableIs/myfile.txt")

Or both are wrong?

Thank you in advance !
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 576
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

Post by bembulak »

You are not able to crosscompile your server from Windows(r) to get a Linux binary.
You have to setup a working PB installation on Linux to do that. It's not possible to do that via Cygwin either.
You can use a virtual-Box oder VMWare Image and run a linux (there are several working Image-Files with all needed libs to run PB on the web).
Or just run a Ubuntu-VM-Ware image and use the tutorial from the forum. Will take you less than 10 minutes to have it working.

The path basically should work, if you start the binary from a user's home directory or from another path, we're the owner+executor has write-permission. But if you place your binary in /bin/ a normal user will not have write-permission, so the file won't be created.
Therefore it's better to use

Code: Select all

createfile(0, GetHomedirectory+'myfile.txt')
or something similar. Important is, that the user/executor of the file has writing permission to the directory. Also, it will keep your filesystem much more clean not to place those files "anywhere".

Hope this helps.
cheers,

bembulak
Flastick
New User
New User
Posts: 6
Joined: Mon Feb 11, 2008 11:53 pm

Post by Flastick »

Yes it helps, thank you for you answer.

I didn't know WMware and VirtualBox. I'm going to try the last one now :-)
Flastick
New User
New User
Posts: 6
Joined: Mon Feb 11, 2008 11:53 pm

Post by Flastick »

It's working great !!! Thank you !!


And a special thank to the people who created virtualbox! It shouldn't have been easy to do such a nice software !!

Flav
chandan
New User
New User
Posts: 1
Joined: Thu Oct 04, 2012 9:02 am

Re: Create a linux executable file using windows ???

Post by chandan »

Hii,

I want to do the same but i have no idea of What is VirtualBox.
Can anyone plzzz guide me with detail step by step process of it.

I have worked on windows for a while but have never used Linux.

Thanks
Chandan
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Create a linux executable file using windows ???

Post by ts-soft »

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply