Anyone tried to compile GLFW for Linux?

Monkey Targets Forums/Desktop/Anyone tried to compile GLFW for Linux?

Aman(Posted 2012) [#1]
I would like to add support for Linux in my games.
I tried to compile it on my old Ubuntu machine.
g++ Main.cpp -o MonkeyGame -lGL -lopenal -lglfw

but it wouldn't compile. Any tips?

Update:
I don't think anyone is interested but I will do this anyway.
I got it to compile but the main issues is with the STB_IMAGE file which is causing issues preventing the app to run or compile.

I found a cocos side project that uses STB_IMAGE with GLFW and it works for him. I just need to figure it out. I wonder why monkey does not support Linux target!!?

Diddy's LaunchBrowser and LaunchEmail should be removed or fixed in order for this to work. My file stream functions caused some issues and had to remove them.


frank(Posted 2012) [#2]
I am interested and so are others; http://www.monkeycoder.co.nz/Community/posts.php?topic=1956 . I think it's important to support this as target...


frank(Posted 2012) [#3]
Do we actually have permission to make it all working on Linux and distribute it here? Any chance it'll get into the 'next version' if we do?


slenkar(Posted 2012) [#4]
has the IDE been ported to Linux?


frank(Posted 2012) [#5]
No, but it would be interesting to have the code compile on Linux; the IDE is secondary. If the compiler works, it wouldn't be too hard to work with emacs or vim.


mardrag(Posted 2012) [#6]
This would be really interesting.
Most of my work is done under linux.
But for monkey I still have to boot windows..


Aman(Posted 2012) [#7]
@frank

I don't think there would be a problem with adding support for Linux. And if it works fine, I think that it could be added to the next version. This is a very good collaborated community. You should worry about getting it to work first.

@mardrag and @slenkar
IDE is not an issue since you can use any text editor. Personally, I don't like Monk and would prefer gedit with few customization to properly syntax highlight Monkey Code and compile it. To actually compile the code, you will have to use the trans tool http://blitz-wiki.appspot.com/Trans

I never tried this but I think it should work unless if trans does not work with Linux which will be extremely strange.


Shinkiro1(Posted 2012) [#8]
Back then when I was on Linux I wrote a monkey language file for gedit. Gedit is a lot like Textmate and with some plugins really a great text editor.

Monkey Lang File + some useful plugins like completition
http://dl.dropbox.com/u/2892658/forum/monkey_gedit.zip
(monkey lang file not up to date)


slenkar(Posted 2012) [#9]
to compile trans for linux you need trans for linux :) ?


fsoft(Posted 2012) [#10]
Hello,

I successfully ported "trans" on Linux and also the GLFW target. :-)

Mark, if you want, I can send you my patches against Monkey Pro 56b.

Please, let me know.


Aman(Posted 2012) [#11]
Cool. Would you mind posting them here?


NoOdle(Posted 2012) [#12]
Yea I'd love to try it out... will this work with RaspberryPi?


fsoft(Posted 2012) [#13]
The process is a bit complicated now.

I could create some patch files against v56 but you have to modify your original files.

I only touched in src/trans and some lines in the glfw target.

I am waiting for the next version of Monkey to make a patch that will last a bit longer :-)

Considering the small amount of time it took me to port GLFW to Linux I am wondering why it is taking so much for Mark to release Monkey for Linux...


Aman(Posted 2012) [#14]
I guess that is due to the lack of demand :)
There are people asking for it and a patch that is ready to implement. I think that will encourage Mark to add support for Linux.


fsoft(Posted 2012) [#15]
For anyone interested, I have created a patch file that patches all Monkey 56b to work with Linux.

You can find it here:

http://fabio.rotondo.it/monkey.linux.patch.gz

If you are not able to apply the patch file, it should be easy to patch the file by hand because all the modifications are just 111 lines of patch file (including blank lines)

Hope it helps :-)


DruggedBunny(Posted 2012) [#16]
Cool, thanks... have you tried emailing Mark, BTW? He may not have seen these posts.


fsoft(Posted 2012) [#17]
Hi James,

actually I have not contacted Mark for this patch / project.

I have always had luck contacting Mark through this forum, so I didn't ever consider mailing him directly... also because I don't have his email :-)

Anyway, I think that Mark is quite busy these days, expecially considering the release rate he always keeps with Monkey (he is a bit out of time now ... I was expecting a new release last week ;-) ).

Also, maybe like Aman says, there is just luck of demand for a Linux version :-)


Aman(Posted 2012) [#18]
Great, thank you so much.


jondecker76(Posted 2012) [#19]
I don't mean to sound stupid, but how do i apply the patch file? I've tried it from within the MonkeyPro folder, outside of it , and everywhere in between. Any tips?
traceydecker82@main-desktop:~/Downloads$ patch -u ./MonkeyPro56b monkey.linux.patch
The next patch would create the file ./MonkeyPro56b,
which already exists!  Assume -R? [n] n
Apply anyway? [n] y
patch: **** File ./MonkeyPro56b is not a regular file -- can't patch




fsoft(Posted 2012) [#20]
Hi jondecker76, these are all the steps to follow in order to apply the patch:

0 - Download MonkeyPro 56b original zip file
1 - Download my file from http://fabio.rotondo.it/monkey.linux.patch.gz
2 - Open Monkey archive
3 - Extract my patch with
gunzip monkey.linux.patch.gz

4 - enter the Monkey dir and type
patch -p1 -i (path of the patch file)/monkey.linux.patch


You should now have a Monkey patched :-)

Then you need to go inside src/trans and build trans_linux with the following command:

trans_linux -target=stdcpp -config=release trans.monkey


(this implies you already have a working trans_linux on your system...)

Hope it helps!


jondecker76(Posted 2012) [#21]
Thanks a lot. I have a few posts already on some of these subjects, but please check them out as it sounds like you can help. I have Monk running under Linux right now, and MServer as well.


jondecker76(Posted 2012) [#22]
Ok, I have the sources patched, but in trying to build the new trans_linux I error out (I do have the trans_linux binary installed)

traceydecker82@main-desktop:~/Downloads/MonkeyPro56b/src/trans$ ../../bin/trans_linux -target=stdcpp -config=release trans.monkey
TRANS monkey compiler V1.17
Parsing...
/home/traceydecker82/Downloads/MonkeyPro56b/modules/monkey/list.monkey<333> : Error : Syntax error - expecting identifier.



thanks again!


fsoft(Posted 2012) [#23]
hmmn it seems that you have a version of Monkey VERY old...

I think Mark added reflection also in the Trans program at some point and this can cause compiling pribkems...


NoOdle(Posted 2012) [#24]
hmmn it seems that you have a version of Monkey VERY old...

looks like the version is up to date, 56b:
/home/traceydecker82/Downloads/MonkeyPro56b/



jondecker76(Posted 2012) [#25]
I probably have to compile a more recent trans - I just downloaded binaries from this thread: http://www.monkeycoder.co.nz/Community/posts.php?topic=1480#13456
which looks like they were compiled from v44 - so I'm sure thats my issue. I'll recompile trans for linux in the morning after I get off work


fsoft(Posted 2012) [#26]
hmmn it seems that you have a version of Monkey VERY old...

I think Mark added reflection also in the Trans program at some point and this can cause compiling problems...


fsoft(Posted 2012) [#27]
I wrote also a Vim file for syntax highlighting, if somebody is interested... ;-)


mardrag(Posted 2012) [#28]
The link http://fabio.rotondo.it/monkey.linux.patch.gz seems to be dead?
Is there a place where I can download the patch?
I'd really like to use the GLFW-target for Linux.


DruggedBunny(Posted 2012) [#29]
I'm also wondering what's needed to get GLFW running on Linux. My Raspberry Pi is here, and, well... !


fsoft(Posted 2012) [#30]
@mardrag sorry, I removed the patch some days ago, Now it is up again.


mardrag(Posted 2012) [#31]
@fsoft: Thanks!


slenkar(Posted 2012) [#32]
has anyone got mserver for linux built?
I cant get blitzmax to run on linux


frank(Posted 2012) [#33]
I just got a http://openpandora.org/ and would really like to develop Monkey games on it. What would be needed to do that?


slenkar(Posted 2012) [#34]
Shouldnt be too difficult actually, just send me one through the mail and Ill get it working :).

Compile trans for linux ARM... hmm maybe you could compile trans on the pandora itself?? (with GCC)

You would have to use a different server other than Mserver cos blitzmax doesnt do ARM.

The IDE is probably out of the question too.


If you want to develop native apps for pandora you might want to edit the mojo file for a target that uses OpenGLES already.
The C++ code for 'opening a window' and loading files for pandora would have to be added in if they are different to c++ linux commands.


frank(Posted 2012) [#35]
Compile trans for linux ARM... hmm maybe you could compile trans on the pandora itself?? (with GCC)
=> that should work, i'm going to try that anyway first :)

Pandora is just a full Linux with OpenGL , so I would think there shouldn't be any problems besides MServer, but that's not a big deal anyway.


Risc(Posted 2012) [#36]
I posted this to the wrong forum. I'm a bit late, but if you're still interested, check it out. I go through all the steps in detail on how to build the GLFW-target for linux.