Error Compiling node.js v0.10.31 for armv7 - javascript

When trying to compile Node.js v0.10.31 (and v0.10.30) on Ubuntu 14.04 for use on Raspberry pi (running ARM). I'm using the following compiler flags:
export AR=arm-linux-gnueabihf-ar
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export LINK=arm-linux-gnueabihf-g++
However I get the following error:
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/ubuntu/node/out'
arm-linux-gnueabihf-g++ -pthread -rdynamic -Wl,--whole-archive /home/ubuntu/node/out/Release/libopenssl.a -Wl,--no-whole-archive -Wl,--whole-archive /home/ubuntu/node/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a -Wl,--no-whole-archive -pthread -o /home/ubuntu/node/out/Release/node -Wl,--start-group /home/ubuntu/node/out/Release/obj.target/node/src/fs_event_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/cares_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/handle_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/node.o /home/ubuntu/node/out/Release/obj.target/node/src/node_buffer.o /home/ubuntu/node/out/Release/obj.target/node/src/node_constants.o /home/ubuntu/node/out/Release/obj.target/node/src/node_extensions.o /home/ubuntu/node/out/Release/obj.target/node/src/node_file.o /home/ubuntu/node/out/Release/obj.target/node/src/node_http_parser.o /home/ubuntu/node/out/Release/obj.target/node/src/node_javascript.o /home/ubuntu/node/out/Release/obj.target/node/src/node_main.o /home/ubuntu/node/out/Release/obj.target/node/src/node_os.o /home/ubuntu/node/out/Release/obj.target/node/src/node_script.o /home/ubuntu/node/out/Release/obj.target/node/src/node_stat_watcher.o /home/ubuntu/node/out/Release/obj.target/node/src/node_string.o /home/ubuntu/node/out/Release/obj.target/node/src/node_zlib.o /home/ubuntu/node/out/Release/obj.target/node/src/pipe_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/signal_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/string_bytes.o /home/ubuntu/node/out/Release/obj.target/node/src/stream_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/slab_allocator.o /home/ubuntu/node/out/Release/obj.target/node/src/tcp_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/timer_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/tty_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/process_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/v8_typed_array.o /home/ubuntu/node/out/Release/obj.target/node/src/udp_wrap.o /home/ubuntu/node/out/Release/obj.target/node/src/node_crypto.o /home/ubuntu/node/out/Release/obj.target/deps/openssl/libopenssl.a /home/ubuntu/node/out/Release/obj.target/deps/zlib/libchrome_zlib.a /home/ubuntu/node/out/Release/obj.target/deps/http_parser/libhttp_parser.a /home/ubuntu/node/out/Release/obj.target/deps/cares/libcares.a /home/ubuntu/node/out/Release/obj.target/deps/uv/libuv.a /home/ubuntu/node/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a /home/ubuntu/node/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a -Wl,--end-group -lm -ldl -lrt
/home/ubuntu/node/out/Release/libopenssl.a(armcap.o): In function `OPENSSL_cpuid_setup':
armcap.c:(.text.startup+0x0): multiple definition of `OPENSSL_cpuid_setup'
/home/ubuntu/node/out/Release/libopenssl.a(cryptlib.o):cryptlib.c:(.text+0x360): first defined here
/home/ubuntu/node/out/Release/libopenssl.a(armcap.o): In function `OPENSSL_rdtsc':
armcap.c:(.text+0x36): undefined reference to `_armv7_tick'
/home/ubuntu/node/out/Release/libopenssl.a(armcap.o): In function `OPENSSL_cpuid_setup':
armcap.c:(.text.startup+0xe0): undefined reference to `_armv7_tick'
armcap.c:(.text.startup+0x10c): undefined reference to `_armv7_neon_probe'
collect2: error: ld returned 1 exit status
make[1]: *** [/home/ubuntu/node/out/Release/node] Error 1
make[1]: Leaving directory `/home/ubuntu/node/out'
make: *** [node] Error 2
Any ideas how to solve this error? Thank you!

I recently installed Node on a Raspberry Pi (do not use apt-get, even on Raspbian. If you can move to Raspbian, as far as I know Ubuntu doesn't like ARM). Try this:
$ cd /home/pi/node/ #or any directory you want
$ wget http://node-arm.herokuapp.com/node_latest_armhf.deb
$ sudo dpkg -i node_latest_armhf.deb
If you try to open the REPL ($ node) and this gives you an error, it's probably because it can't find the executable find. In that case this following command made it work for me:
$ hash -r

I used the following to install node.js on RPi.
Install Node on the Raspberry Pi in 5 minutes
The problem I found was that the latest node.js distribution (v0.10.31) did not include the precompiled version for the RPi. I had to go the last distribution that contained the precompiled node.js for the RPi (v0.10.28). Here is the link to the distribution repository:
http://nodejs.org/dist/

Related

Cannot run Parcel in my project (Parcel does not create dist with compiled file)

Please help me figure out the problem. I can not understand the essence of the error and how to fix it.
I initialize the project: npm init -y
Install Parcel: npm install --save-dev parcel
I create src directory with an index.html file.
When I run the npx parcel src/index.html command, I get an error:
Error: The filename, directory name, or volume label syntax is incorrect.
at Object.open (C:\Users\dell\OneDrive\Документи\Projects\Test\node_modules\lmdb\dist\index.cjs:1936:3)
at new LMDBCache (C:\Users\dell\OneDrive\Документи\Projects\Test\node_modules#parcel\cache\lib\LMDBCache.js:69:34)
at resolveOptions (C:\Users\dell\OneDrive\Документи\Projects\Test\node_modules#parcel\core\lib\resolveOptions.js:112:168)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Parcel._init (C:\Users\dell\OneDrive\Документи\Projects\Test\node_modules#parcel\core\lib\Parcel.js:218:27)
at async Parcel.watch (C:\Users\dell\OneDrive\Документи\Projects\Test\node_modules#parcel\core\lib\Parcel.js:315:7)
at async run (C:\Users\dell\OneDrive\Документи\Projects\Test\node_modules\parcel\lib\cli.js:349:9) {
code: 123 }
I had the same issue. I resolved it by changing the line at node_modules#parcel\core\lib\resolveOptions.js:112:168 to
let cache = (_initialOptions$cache = initialOptions.cache) !== null && _initialOptions$cache !== void 0 ? _initialOptions$cache : new (_cache().FSCache)(outputFS, cacheDir);
Basically, I removed the
outputFS instanceof _fs().NodeFS ? new (_cache().LMDBCache)(cacheDir) : part of that line. For some unknown reason, there seems to be a problem with LMDBCache and Parcel.
You're missing the build command from npx parcel src/index.html:
Update to:
npx parcel build src/index.html.

How can I transfer JS to native machine code (using v8)

I've tried the suggest in the url:
How can I see the machine code generated by v8?
Here is what I did:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools
sudo apt-get install libv8-dev
sudo apt-get install g++
sudo apt-get install libgtk2.0-dev
sudo apt-get install g++-multilib
export PATH="$PATH":`pwd`/depot_tools
fetch v8
gclient sync
make ia32.release objectprint=on disassembler=on
v8/out/ia32.release/d8 --print-all-code hello.js > output.txt
(The script is just:print("hello"))
Below are the output:
kind = STUB
major_key = JSEntryStub
compiler = unknown
Instructions (size = 131)
0x35d06040 0 55 push ebp
0x35d06041 1 89e5 mov ebp,esp
0x35d06043 3 6a02 push 0x2
......
0x35d060c2 82 c3 ret
Handler Table (size = 12)
RelocInfo (size = 23)
0x35d06047 external reference (Isolate::context_address) (0xa9533dc)
0x35d06050 external reference (Isolate::c_entry_fp_address) (0xa953410)
......
kind = STUB
major_key = JSEntryStub
compiler = unknown
Instructions (size = 131)
0x35d06120 0 55 push ebb
......
Indeed,I have a batch of code,but it doesn't vary from the input script.
By the way,the output is certainly too much(about 13M text) for a simple script.
Thanks.
With current V8 versions (5.9 or later), you probably want the --print-opt-code flag: initially, V8 generates byte code for its interpreter (which you can inspect with --print-bytecode); once a function is "hot" (i.e. a lot of time is spent executing it), it is sent to the optimizing compiler to generate machine code for it.
Note that you cannot use V8 as a general purpose JavaScript-to-machine-code compiler. The flags mentioned above are intended for debugging; there is no (supported or easy) way to produce working binaries from their output.

Compiling GMP/MPFR with Emscripten

Alright, this has been driving me insane. I've been trying this for at least a month, and no where on the internet is helping.
I followed the steps of this. Not even the example works when I do these steps, because when I do it, I get this.
bitcode ==> javascript
warning: unresolved symbol: __gmpz_cmp
warning: unresolved symbol: __gmpz_mul_ui
warning: unresolved symbol: __gmpz_submul_ui
warning: unresolved symbol: __gmpz_init_set_ui
warning: unresolved symbol: __gmpz_mul_2exp
warning: unresolved symbol: __gmpz_init
warning: unresolved symbol: __gmpz_fdiv_qr
warning: unresolved symbol: __gmpz_add
And when I run the resulting complete.js file -
missing function: __gmpz_init
-1
-1
/home/ubuntu/workspace/gmp.js/complete.js:117
throw ex;
^
abort(-1) at Error
at jsStackTrace (/home/ubuntu/workspace/gmp.js/complete.js:1045:13)
at stackTrace (/home/ubuntu/workspace/gmp.js/complete.js:1062:22)
at abort (/home/ubuntu/workspace/gmp.js/complete.js:6743:44)
at ___gmpz_init (/home/ubuntu/workspace/gmp.js/complete.js:1744:56)
at Object._main (/home/ubuntu/workspace/gmp.js/complete.js:4978:2)
at Object.callMain (/home/ubuntu/workspace/gmp.js/complete.js:6627:30)
at doRun (/home/ubuntu/workspace/gmp.js/complete.js:6681:60)
at run (/home/ubuntu/workspace/gmp.js/complete.js:6695:5)
at Object.<anonymous> (/home/ubuntu/workspace/gmp.js/complete.js:6769:1)
at Module._compile (module.js:541:32)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
These instructions are for a host running amd64 Debian Buster. It seems that GMP no longer needs 32bit to work with Emscripten (and in any case 32bit Emscripten seems no longer supported?), but I used a chroot for clean environment. After installing, my chroot was 1.6GB large. But I wouldn't recommend using it for compute-intensive code if you can avoid it, in one benchmark my native code was 15 times faster than the same code compiled with Emscripten running in nodejs...
Debian Buster chroot
mkdir emscripten
sudo debootstrap buster emscripten
sudo chroot emscripten /bin/bash
echo "deb http://security.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list
apt update
apt install python cmake g++ git lzip wget nodejs m4
echo "none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0" >> /etc/fstab
mount /dev/shm
echo "none /proc proc defaults 0 0" >> /etc/fstab
mount /proc
adduser emscripten
su - emscripten
emsdk latest
At time of writing this installed
releases-upstream-b024b71038d1291ed7ec23ecd553bf2c0c8d6da6-64bit
and node-12.9.1-64bit:
git clone https://github.com/juj/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
mkdir -p ${HOME}/opt/src
cd ${HOME}/opt/src
gmp 6.1.2
wget https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz
tar xf gmp-6.1.2.tar.lz
cd gmp-6.1.2
emconfigure ./configure --disable-assembly --host none --enable-cxx --prefix=${HOME}/opt
make
make install
cd ..
mpfr 4.0.2
wget https://www.mpfr.org/mpfr-current/mpfr-4.0.2.tar.xz
wget https://www.mpfr.org/mpfr-current/allpatches
tar xf mpfr-4.0.2.tar.xz
cd mpfr-4.0.2
patch -N -Z -p1 < ../allpatches
emconfigure ./configure --host none --prefix=${HOME}/opt --with-gmp=${HOME}/opt
make
make install
cd ..
mpc 1.1.0
wget https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz
tar xf mpc-1.1.0.tar.gz
cd mpc-1.1.0
emconfigure ./configure --host none --prefix=${HOME}/opt --with-gmp=${HOME}/opt --with-mpfr=${HOME}/opt
make
make install
cd ..
hello world
Your favourite program using GMP/MPFR/MPC:
emcc -o hello.js hello.c \
${HOME}/opt/lib/libmpc.a ${HOME}/opt/lib/libmpfr.a ${HOME}/opt/lib/libgmp.a
nodejs hello.js
I found out to do it, you need to be using a 32 bit machine. I had a 64 bit machine so I chroot'ed into a 32 bit filesystem using this tutorial.
After that, everything worked well. I was making a Mandelbrot program using GMP and MPFR, and I posted the compiling script (along with the program itself) online on GitHub. Here it is. Adapt it for your own projects.
I packaged it into a NPM library called gmp-wasm. You can find a Dockerized code which builds the library within the source. It exports both low-level functions and an immutable high-level wrapper:
<script src="https://cdn.jsdelivr.net/npm/gmp-wasm"></script>
<script>
gmp.init().then(({
calculate
}) => {
// calculate() automatically deallocates all objects
// created within the callback function
const result = calculate((g) => {
const six = g.Float(1).add(5);
const res = g.Pi().div(six).sin();
return res;
});
document.write(`sin(Pi/6) = ` + result);
});
</script>
Using low-level functions:
<script src="https://cdn.jsdelivr.net/npm/gmp-wasm"></script>
<script>
gmp.init().then(({
calculate, binding
}) => {
const result = calculate((g) => {
const a = g.Float(1);
const b = g.Float(2);
const c = g.Float(0);
// c = a + b
binding.mpfr_add(c.mpfr_t, a.mpfr_t, b.mpfr_t, 0);
return c;
});
document.write(`1 + 2 = ` + result);
});
</script>

Can Emstripten compile the iostream library?

I'm on Ubuntu.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
I installed Emscripten.
$ sudo apt-get install emscripten
I wrote the following C++ program:
#include <iostream>
int main(){
printf("hello world\n");
}
It compiles as expected.
$ emcc -O1 -s ASM_JS=1 main.cpp
$
However, when I write a similar program using the iostream facilities:
#include <iostream>
int main(){
std::cout << "hello world" << std::endl;
}
It fails to build.
$ emcc -O1 -s ASM_JS=1 main.cpp
aborting from js compiler due to exception: unknown vector type <4 x i8> | undefined
aborting from js compiler due to exception: unknown vector type <4 x i8> | undefined
aborting from js compiler due to exception: unknown vector type <4 x i8> | undefined
Traceback (most recent call last):
File "/usr/share/emscripten/emscripten.py", line 1352, in <module>
_main(environ=os.environ)
File "/usr/share/emscripten/emscripten.py", line 1340, in _main
temp_files.run_and_clean(lambda: main(
File "/usr/share/emscripten/tools/tempfiles.py", line 39, in run_and_clean
return func()
File "/usr/share/emscripten/emscripten.py", line 1348, in <lambda>
DEBUG_CACHE=DEBUG_CACHE,
File "/usr/share/emscripten/emscripten.py", line 1235, in main
jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
File "/usr/share/emscripten/emscripten.py", line 292, in emscript
assert len(output) == 2, 'Did not receive forwarded data in an output - process failed? We only got: ' + output[0][-3000:]
AssertionError: Did not receive forwarded data in an output - process failed? We only got: ((HEAP32[(($1)>>2)])|0);
$3=((($2)-(12))|0);
$4=$3;
$5=((HEAP32[(($4)>>2)])|0);
$6=$this;
$_sum=((($5)+(24))|0);
$7=(($6+$_sum)|0);
$8=$7;
$9=((HEAP32[(($8)>>2)])|0);
$10=($9|0)==0;
if ($10) {
STACKTOP=sp;return (($this)|0);
}
$12=(($__s)|0);
HEAP8[($12)]=0;
$13=(($__s+4)|0);
HEAP32[(($13)>>2)]=$this;
$_sum_i=((($5)+(16))|0);
$14=(($6+$_sum_i)|0);
$15=$14;
$16=((HEAP32[(($15)>>2)])|0);
$17=($16|0)==0;
do {
if ($17) {
$_sum1_i=((($5)+(72))|0);
$19=(($6+$_sum1_i)|0);
$20=$19;
$21=((HEAP32[(($20)>>2)])|0);
$22=($21|0)==0;
if (!($22)) {
$24=((__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv($21))|0);
}
HEAP8[($12)]=1;
$26=((HEAP32[(($1)>>2)])|0);
$27=((($26)-(12))|0);
$28=$27;
$29=((HEAP32[(($28)>>2)])|0);
$_sum1=((($29)+(24))|0);
$30=(($6+$_sum1)|0);
$31=$30;
$32=((HEAP32[(($31)>>2)])|0);
$33=$32;
$34=$32;
$35=((HEAP32[(($34)>>2)])|0);
$36=(($35+24)|0);
$37=((HEAP32[(($36)>>2)])|0);
$38=((FUNCTION_TABLE_ii[($37)&{{{ FTM_ii }}}]($33))|0);
$39=($38|0)==-1;
if (!($39)) {
break;
}
$41=((HEAP32[(($1)>>2)])|0);
$42=((($41)-(12))|0);
$43=$42;
$44=((HEAP32[(($43)>>2)])|0);
$45=(($6+$44)|0);
$46=$45;
$_sum2=((($44)+(16))|0);
$47=(($6+$_sum2)|0);
$48=$47;
$49=((HEAP32[(($48)>>2)])|0);
$50=$49|1;
__ZNSt3__18ios_base5clearEj($46,$50);
}
} while(0);
__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev($__s);
STACKTOP=sp;return (($this)|0);
}
function __ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv($this){
$this=($this)|0;
var $1=0,$2=0,$3=0,$4=0,$5=0,$6=0,$7=0,label=0;
$1=(($this+16)|0);
$2=((HEAP32[(($1)>>2)])|0);
$3=$2|1;
HEAP32[(($1)>>2)]=$3;
$4=(($this+20)|0);
$5=((HEAP32[(($4)>>2)])|0);
$6=$5&1;
$7=($6|0)==0;
if ($7) {
return;
} else {
___cxa_rethrow();
}
}
function __ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev($this){
$this=($this)|0;
var $1=0,$2=0,label=0;
$1=(($this+8)|0);
__ZNSt3__18ios_baseD2Ev($1);
$2=$this;
__ZdlPv($2);
return;
}
function __ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev($this){
$this=($this)|0;
var $1=0,label=0;
$1=(($this+8)|0);
__ZNSt3__18ios_baseD2Ev($1);
return;
}
function __ZTv0_n12_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev($this){
$this=($this)|0;
var $1=0,$2=0,$3=0,$4=0,$5=0,$6=0,$7=0,$_sum=0,$8=0,$9=0,label=0;
$1=$this;
$2=$this;
$3=((HEAP32[(($2)>>2)])|0);
$4=((($3)-(12))|0);
$5=$4;
$6=((HEAP32[(($5)>>2)])|0);
$7=(($1+$6)|0);
$_sum=((($6)+(8))|0);
$8=(($1+$_sum)|0);
$9=$8;
__ZNSt3__18ios_baseD2Ev($9);
__ZdlPv($7);
return;
}
function __ZTv0_n12_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev($this){
$this=($this)|0;
var $1=0,$2=0,$3=0,$4=0,$5=0,$6=0,$_sum=0,$7=0,$8=0,label=0;
$1=$this;
$2=$this;
$3=((HEAP32[(($2)>>2)])|0);
$4=((($3)-(12))|0);
$5=$4;
$6=((HEAP32[(($5)>>2)])|0);
$_sum=((($6)+(8))|0);
$7=(($1+$_sum)|0);
$8=$7;
__ZNSt3__18ios_baseD2Ev($8);
return;
}
Traceback (most recent call last):
File "/usr/bin/emcc", line 1864, in <module>
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
File "/usr/share/emscripten/tools/shared.py", line 1276, in emscripten
assert os.path.exists(filename + '.o.js') and len(open(filename + '.o.js', 'r').read()) > 0, 'Emscripten failed to generate .js: ' + str(compiler_output)
AssertionError: Emscripten failed to generate .js:
I was under the impression that Emscripten has come a long way, and is capable of compiling entire C++ games for the browser! Is there some kind of flag or configuration I missed in order to sucessfully compile portions of the C++ standard library? I know that clang/gcc compilers will link against the C++ standard shared library by default. Does the issue have something to do with that you think?
I have also tried using the command em++ in place of emcc and recieved the same error message.
If relevant, here is the default configuration that was built when running emscripten for the first time:
$ cat ~/.emscripten
# Note: If you put paths relative to the home directory, do not forget os.path.expanduser
import os
# this helps projects using emscripten find it
EMSCRIPTEN_ROOT = os.path.expanduser(os.getenv('EMSCRIPTEN') or '/usr/share/emscripten') # directory
LLVM_ROOT = os.path.expanduser(os.getenv('LLVM') or '/usr/bin') # directory
PYTHON = os.path.expanduser(os.getenv('PYTHON') or '/usr/bin/python2') # executable
# See below for notes on which JS engine(s) you need
NODE_JS = os.path.expanduser(os.getenv('NODE') or '/usr/bin/node') # executable
SPIDERMONKEY_ENGINE = [os.path.expanduser(os.getenv('SPIDERMONKEY') or 'js')] # executable
V8_ENGINE = os.path.expanduser(os.getenv('V8') or 'd8') # executable
JAVA = 'java' # executable
TEMP_DIR = '/tmp'
CRUNCH = os.path.expanduser(os.getenv('CRUNCH') or 'crunch') # executable
#CLOSURE_COMPILER = '..' # define this to not use the bundled version
########################################################################################################
# Pick the JS engine to use for running the compiler. This engine must exist, or
# nothing can be compiled.
#
# Recommendation: If you already have node installed, use that. Otherwise, build v8 or
# spidermonkey from source. Any of these three is fine, as long as it's
# a recent version (especially for v8 and spidermonkey).
COMPILER_ENGINE = NODE_JS
#COMPILER_ENGINE = V8_ENGINE
#COMPILER_ENGINE = SPIDERMONKEY_ENGINE
# All JS engines to use when running the automatic tests. Not all the engines in this list
# must exist (if they don't, they will be skipped in the test runner).
#
# Recommendation: If you already have node installed, use that. If you can, also build
# spidermonkey from source as well to get more test coverage (node can't
# run all the tests due to node issue 1669). v8 is currently not recommended
# here because of v8 issue 1822.
JS_ENGINES = [NODE_JS] # add this if you have spidermonkey installed too, SPIDERMONKEY_ENGINE]
I can't seem to find a way to get the basic C++ program above to successfully compile.
First, your program compiles fine for me with emcc. Your original program (with printf) causes emcc to assume it is compiling C code and as such it will auto-include stdio.h as C does. Your second program is having more trouble, probably due to an install error (for me I had an issue like this because my version of LLVM doesn't line up with the exact version Emscripten needed.)
Unfortunately, my understanding is that this is a common problem with emscripten and auto installers like apt-get -- I had the problem with both port and brew on my Mac.
The solution is to get Emscripten through the SDK, which bundles all of the sensitive pieces together: https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html
Follow the instructions there carefully. The two problems I ran into were that it expects Python 2 to be called python2 on your system and the script to adjust your default path assumes you're using bash (if you are, it should work fine.)

Could not invoke JSLint! jslint.vim cannot work in windows 7 (x64)

I use hallettj / jslint.vim on Ubuntu 12.04, everything is ok. but on windows 7(x64), it displays error:
Error detected while processing function <SNR>42_JSLint:
line 47:
The filename, directory name, or volume label syntax is incorrect ^#
Error detected while processing function <SNR>42_JSLint:
line 48:
could not invoke JSLint!
I try to solve the problem as follow, but not work:
rename jslint.vim/bim/jslint to jslint.exe then add to PATH
modify jslint.vim file:
" let s:install_dir = expand(":p:h")
if has("win32")
let s:install_dir = '"' .
expand("C:\Users\Administrator.vim\bundle\jslint.vim\ftplugin\javascript"). '"'
else
let s:install_dir = expand(":p:h")
endif
install node.js, npm using npm install jslint -g to install jslint om cmd.exe
BTW: I adopt Vindle to manage my plugins.
This is my _vimrc.
I've solved the problem. I think that the trick is run-time language, even through setting language en in _vimrc file is not used.
The solution is:
Uninstall the gvim completely.
custom install gvim,do NOT check Native Language Support option.
So everything is right!

Categories

Resources