Emscripten and Eclipse

668 views
Skip to first unread message

Erasme Beck

unread,
Mar 21, 2014, 6:42:17 PM3/21/14
to emscripte...@googlegroups.com
Hello,

I'm new to Emscripten and I'd like to use Eclipse (on Linux) to compile my Ogre projects with Emscripten.

Here is how I set up Eclipse:
In properties -> C++ Build -> Settings -> GCC C++ Compiler: I replaced g++ by em++
Same thing for the GCC C++ Linker

- First I made a "hello world" test and it works fine.
- Compiling my Ogre project with g++ in Eclipse works fine too.
- Compiling with em++ fails, unable to find an include file (/usr/local/include/OGRE/OgreIteratorRange.h:48:13: fatal error: 'boost/range.hpp' file not found).

I can post more details if needed to help me solve my issue.

Can someone help me setting up Eclipse to work with emscripten?

Thank you.

Alon Zakai

unread,
Mar 22, 2014, 5:03:23 PM3/22/14
to emscripte...@googlegroups.com
Boost is not included in emscripten's standard libraries, you will need to add it to your application manually.

- Alon



--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Erasme Beck

unread,
Mar 22, 2014, 5:06:32 PM3/22/14
to emscripte...@googlegroups.com

Thank you son much Alon!

You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/ZxYwgU0DNNM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

Erasme Beck

unread,
Mar 24, 2014, 2:18:58 PM3/24/14
to emscripte...@googlegroups.com
Hello!

I added the boost library to my project. Compiling the projet produced a binary file without extension. So I guessed it's a .bc file.
I renamed it accordingly.
then I did:
em++ project.bc -o project.html

I opened the html file that shows a wondeful "-1" on the screen.

I guess I didn't configured Eclipse properly.

Has someone managed to compiled a test project like the "bullet" test project with Eclipse? 

Alon Zakai

unread,
Mar 24, 2014, 2:29:42 PM3/24/14
to emscripte...@googlegroups.com
Look in the web console, there may be more information about what went wrong.

Also building with emcc -v will output verbose logging which can help figure things out.

- Alon



--

Erasme Beck

unread,
Mar 24, 2014, 4:44:59 PM3/24/14
to emscripte...@googlegroups.com
Hello!

I'm sorry for my newbie questions but I don't want to give up!

The web console tells me there are unresolved (many) symbols.
I guess it means I didn't linked properly the different needed libraries...

Alon, you told me to add the libraries manually to my project.
I think this is what I did wrong.
I simply added the boost directory at the root of my project...
Ain't that right?

Again, I'm sorry to waste your time with dummy questions. But if I succeed to show something on the screen I promise I make a tutorial for building a project with Eclipse!

Alon Zakai

unread,
Mar 24, 2014, 5:24:11 PM3/24/14
to emscripte...@googlegroups.com
I am not familiar with eclipse myself. But I am sure you can get it to show all the commandline stuff it ran? Look there to make sure it linked to the library containing the symbol that you get an error about it being undefined. Use llvm-nm to show which symbols are defined in a library or object file when that is helpful.

- Alon



--

Erasme Beck

unread,
Mar 24, 2014, 11:11:48 PM3/24/14
to emscripte...@googlegroups.com
Hello!
here is my naive attempt to build my project:

em++ -L/usr/local/lib -L/usr/lib/i386-linux-gnu -L/home/erasme/Sources/ogre/lib -o "project.html"  ./OgreBasicTutorial1/TutorialApplication.o  ./BaseApplication.o   -lOgreMain -lOIS -lOgreOverlay -lOgreTerrain -lOgrePaging -lboost_system

following these lines in the console, I get a whole bunch of "warning: unresolved symbol".

Thank you for your patience!

Alon Zakai

unread,
Mar 25, 2014, 2:12:06 PM3/25/14
to emscripte...@googlegroups.com
Warnings on unresolved symbols are not necessarily a problem. It's only an issue if they are called at runtime and an abort happens.

Btw, those -L to local system paths are potentially dangerous - emscripten can't use local system libs, which are x86 and tied to your local OS, instead it needs portable bitcode. Emscripten should warn about that though.

- Alon



--
Reply all
Reply to author
Forward
0 new messages