Resolving Error and Warnings

17 views
Skip to first unread message

Mayur Pai

unread,
Jun 18, 2019, 5:10:43 PM6/18/19
to emscripten-discuss
Hi,

I am new to emscripten and got interested as we have a  complex C++ code that we want converted to Javascript.

I am able to install the emscripten and verify the installation and run the convert the sample project hello_world.cpp. However when I try to run one of the cpp file from my C++ project it is giving error. How should i go about resolving this? Is the error because, i am running just 1 file without its dependencies? How to run for the entire project having multiple cpp files?

Below error message snippet

C:\emsdk-master\fastcomp\emscripten\tests\VC6_IS>emcc ISMN.cpp

In file included from ISMN.cpp:30:

./isbool.h:8:19: error: redeclaration of C++ built-in type 'bool'

      typedef int bool ;

                  ^

./isbool.h:9:24: error: expected unqualified-id

      static const int true  = 1 ;

                       ^

./isbool.h:10:24: error: expected unqualified-id

      static const int false = 0 ;

                       ^

ISMN.cpp:31:10: warning: non-portable path to file '"Isdll.h"'; specified path

 

      differs in case from file name on disk [-Wnonportable-include-path]

#include "isdll.h"

         ^~~~~~~~~~

         "Isdll.h"

ISMN.cpp:41:10: warning: non-portable path to file '"ISSC.H"'; specified path

      differs in case from file name on disk [-Wnonportable-include-path]

#include "issc.h"

         ^~~~~~~~~

         "ISSC.H"

ISMN.cpp:46:10: warning: non-portable path to file '"ISSC.H"'; specified path

      differs in case from file name on disk [-Wnonportable-include-path]

#include "issc.h"

         ^~~~~~~~~

         "ISSC.H"

3 warnings and 3 errors generated.

shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting


Regards,
Mayur Pai

Floh

unread,
Jun 19, 2019, 6:33:28 AM6/19/19
to emscripten-discuss
These problems look like the code base has only been compiled on a Windows with Visual Studio (for instance the warnings about the filesystem paths not matching).

My advice is to first port the code to other compilers (e.g. gcc and clang on Linux, or clang on macOS), and then tackle a port to emscripten (the errors and warnings you're currently seeing is most likely just the top of the iceberg).

Cheers,
-Floh.

Emscripten uses clang as compiler, and has a POSIX-ish runtime environment (as opposed to Win32).

Mayur Pai

unread,
Jun 19, 2019, 10:00:55 AM6/19/19
to emscripten-discuss
Thanks Floh for the response. This is helpful.
Is there any utility that will help us port the code?  This is a huge code base and porting it manually may not be possible

Regards,
Mayur Pai

Floh

unread,
Jun 20, 2019, 6:44:13 AM6/20/19
to emscripten-discuss
None that I know of, I guess the only option is to fix one error and warning after another...

Shlomi Fish

unread,
Jun 20, 2019, 7:58:04 AM6/20/19
to Floh, emscripte...@googlegroups.com
On Thu, 20 Jun 2019 03:44:13 -0700 (PDT)
Floh <flo...@gmail.com> wrote:

> None that I know of, I guess the only option is to fix one error and
> warning after another...
>

These may help:

* https://www.shlomifish.org/open-source/portability-libs/

* https://wiki.winehq.org/Winelib
--
-----------------------------------------------------------------
Shlomi Fish

Inigo Montoya: You seem a decent fellow. I hate to kill you.
The Man in Black: You seem a decent fellow. I hate to die.
http://en.wikiquote.org/wiki/The_Princess_Bride_%28film%29
Reply all
Reply to author
Forward
0 new messages