![]() |
compile GNU/Linux binaries in Windows
... It's just possible, this is what you need :)
http://filebase.bots-united.com/inde...on=file&id=278 It's actually just a mere build of the MinGW source code with some extra configs, as MinGW and GNU/Linux version of gcc are actually the same code. |
Re: compile GNU/Linux binaries in Windows
|
Re: compile GNU/Linux binaries in Windows
it's just a GCC built under Windows in this way:
./configure --prefix=c:/gcc-gnulinux --target=i686-pc-linux-gnu make make install Actually MinGW and *NIX gcc are the same code, this just enabled the GNU/Linux compiling instead of default MinGW Windows compiling. It should compile the same as GNU/Linux, but perhaps you need some extra libraries to compile something other than bots. |
Re: compile GNU/Linux binaries in Windows
Can it do cross-compiles? I'd be interested in compiling native Linux binaries for my metamod stuff without needing to upload my sources each time on the BU server.
|
Re: compile GNU/Linux binaries in Windows
I just tried it with pbmm but it seems to create a .so file twice the size of when it is compiled on linux and also gets a badf load...:(
can i compile on the BU server too? |
Re: compile GNU/Linux binaries in Windows
Anybody who has a shell account on the BU machine can compile his plugins... but I think you don't have one yet because you don't have any website for your bot. One more reason to change that :)
|
Re: compile GNU/Linux binaries in Windows
well I've found the problem... try NOT to use "-march" parameter (like -march=i586 or so) and use "_i386.so" as the end of the filename and it should work in Metamod
also note that "gcc" is the C compiler, and "g++" is the c++ compiler so make sure you are compiling C++ code with "g++" command. but the file size is still big, as it's totally staticly linked. |
Re: compile GNU/Linux binaries in Windows
well you also need to use the "-static" parameter...
here's the work Makefile PHP Code:
|
Re: compile GNU/Linux binaries in Windows
Works fine, thanks! :)
btw, I've just found another similiar way to compile win32 binaries from linux 8D: http://www.wxwidgets.org/technote/crosscmp.htm |
Re: compile GNU/Linux binaries in Windows
Yes, and I believe that's what Will Day does with metamod, he compiles everything on GNU/Linuts :)
|
Re: compile GNU/Linux binaries in Windows
Can someone explain me how to compile with this EPB. It will be good to have a linux version.
|
Re: compile GNU/Linux binaries in Windows
So, how do I cross compile for the PDP-11? :P
|
Re: compile GNU/Linux binaries in Windows
"Can someone explain me how to compile with this EPB. It will be good to have a linux version."
just create a file named "Makefile" in your source directory, like this one: PHP Code:
write all your .cpp files in the list, change all .cpp to .o. Then install the compiler, start a DOS prompt, run the setvars.bat file first and change into your source dir. Then run "make" and it should produce a epb_i386.so file and that's it. |
Re: compile GNU/Linux binaries in Windows
Quote:
Code:
CPP = g++ I'd better look into that someday. |
Re: compile GNU/Linux binaries in Windows
It's not working :
here is the error messege: make : <e=2>: make : *** [EPB_i386.so] Error 2 |
Re: compile GNU/Linux binaries in Windows
in which step this error happened? would you post the full output?
(also you need to add the log.o to the list in Makefile if you haven't deleted it, and if you've created new files you need to add them as well) |
Re: compile GNU/Linux binaries in Windows
Here :
dll.cpp:20: error: expected `>` before '*' token dll.cpp:20: error: expected `,` or `;` before '*' token dll.cpp:22: error: expected `>` before '*' token dll.cpp:22: error: expected `,` or `;` before '*' token dll.cpp:29: error: `GETNEWDLLFUNCTIONS` does not name a type make: *** [dll.o] Error 1 The strange is that when I compile it with MSVC there is no problem. |
Re: compile GNU/Linux binaries in Windows
then it's bacause something GNU/Linux specific is missing in the code... you gotta fix it first
search for "__linux__" in HPB bot and you'll see what's required edit: I think this is the problem: PHP Code:
|
Re: compile GNU/Linux binaries in Windows
Thanks you Whistler. You was write ! The problem was in bot.h.
Now I succseful compile EPB for Linux. With the next release I will publish and the Linux version of EPB. Thnaks you again. EDIT : Did I must publish the source code of EPB if I publish a Linux version ? |
Re: compile GNU/Linux binaries in Windows
"Did I must publish the source code of EPB if I publish a Linux version ?"
Nope, as you are just *USING* gcc, which is totally free and not restricted :) perhaps you can read through the GPL to see in which case you need to release the sources. |
Re: compile GNU/Linux binaries in Windows
The PDP-11 is too new anyway. How do I cross compile for the ENIAC?
|
Re: compile GNU/Linux binaries in Windows
"The PDP-11 is to new anyway. How do I cross compile for the ENIAC?"
I don't think ENIAC uses software :) AFAIK you have to change the hardware to make programs in ENIAC for PDP-11 there are several emulators and nowadays AT&T UNIX is free software, so you may find those ones :) |
Re: compile GNU/Linux binaries in Windows
Oops! I just fixed an error in my last post.
Anyway, I think it is kind of funny that GCC supports the PDP-11. I mean, the machine is so damn old. I have never even seen one. |
Re: compile GNU/Linux binaries in Windows
As a note, mingw won't nessecerily compile ALL linux apps to windows, for example, anything which acts as a socket server (for whatever reason) requires the use of winsock, NOT the standard *nix socket.h you can use defines for it all, but it will get messy. For use in bots, its a 'quick fix', but don't expect it to hold out too well, POSIX is still a long way from being ported properly to windows (Hence the larger files).
As another note, cygwin doesn't support Shared Objects.. its a lose lose situation if you have something with both ;) |
Re: compile GNU/Linux binaries in Windows
I've rebuilt the compiler and now it is GCC 2.95 so that it can build HPB bot straightly... and there is also no need to use "-static" now
you may want to redownload it |
Re: compile GNU/Linux binaries in Windows
Whislter where is setvars.bat file? I can't compile in this way. :(
|
Re: compile GNU/Linux binaries in Windows
use this command:
path c:\gcc-gnulinux\bin;%path% |
Re: compile GNU/Linux binaries in Windows
Could you make it so that the install dir is changeable ?
|
Re: compile GNU/Linux binaries in Windows
Quote:
path c:\gcc-gnulinux\bin;%path% with the dir that you are moved the folder. For drive D: it will be : path D:\gcc-gnulinux\bin;%path% |
Re: compile GNU/Linux binaries in Windows
I'm not sure. The GNU linker is weird. Whistler certainly knows more about it.
|
Re: compile GNU/Linux binaries in Windows
Maybe you will need to recompile the source code, as the path is hardcoded in the executable.
I'm not sure if setting the GCC_EXEC_PREFIX environment variable to the correct path and add a whole bunch of -I and -L parameters to the commandline will work, I haven't tried this. See the gcc manuals for details. |
All times are GMT +2. The time now is 19:22. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.