Page 1 of 1

Create a linux executable file using windows ???

Posted: Fri Feb 15, 2008 10:08 pm
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 !

Posted: Fri Feb 15, 2008 10:45 pm
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.

Posted: Fri Feb 15, 2008 11:17 pm
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 :-)

Posted: Sat Feb 16, 2008 3:26 pm
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

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

Posted: Thu Oct 04, 2012 9:14 am
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

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

Posted: Thu Oct 04, 2012 9:18 am
by ts-soft