I am trying to compile the C++ code to WASM but facing problems in it. My C++ code included dlib and OpenCV libraries. I have successfully compiled OpenCV and dlib for C++ environment. Also, I have installed emscripten in my system.
Recently I was facing problems in including the dlib and OpenCV libraries during compilation. So I have asked another question here. Now though I am successfully able to provide header files information. But now I am unable to compile the code. When I am executing the following command:
emcc -msse3 -msimd128 -std=c++11 -O3 -I ../dlib -I ../opencv/build/include main.cpp -lstdc++ -lpthread -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -s TOTAL_MEMORY=1024MB -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap']" -s WASM=1 -o main.js
Then I am getting the following errors:
In file included from main.cpp:5:
In file included from ../dlib\dlib/image_processing/frontal_face_detector.h:8:
In file included from ../dlib\dlib/image_processing/../image_processing/scan_fhog_pyramid.h:8:
In file included from ../dlib\dlib/image_processing/../image_transforms.h:14:
In file included from ../dlib\dlib/image_processing/../image_transforms/spatial_filtering.h:13:
In file included from ../dlib\dlib/image_processing/../image_transforms/../simd.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd4f.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd_check.h:88:
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:13:19: error: typedef redefinition with different types
('__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value) vs
'__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values))
typedef long long __m64 __attribute__((__vector_size__(8), __aligned__(8)));
^
C:\emsdk\upstream\emscripten\system\include\SSE\xmmintrin.h:22:15: note: previous definition is here
typedef float __m64 __attribute__((__vector_size__(8), __aligned__(8)));
^
In file included from main.cpp:5:
In file included from ../dlib\dlib/image_processing/frontal_face_detector.h:8:
In file included from ../dlib\dlib/image_processing/../image_processing/scan_fhog_pyramid.h:8:
In file included from ../dlib\dlib/image_processing/../image_transforms.h:14:
In file included from ../dlib\dlib/image_processing/../image_transforms/spatial_filtering.h:13:
In file included from ../dlib\dlib/image_processing/../image_transforms/../simd.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd4f.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd_check.h:88:
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:33:5: error: use of undeclared identifier '__builtin_ia32_emms';
did you mean '__builtin_isless'?
__builtin_ia32_emms();
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:33:5: note: '__builtin_isless' declared here
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:33:25: error: too few arguments to function call, expected 2,
have 0
__builtin_ia32_emms();
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:50:19: error: use of undeclared identifier
'__builtin_ia32_vec_init_v2si'
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:67:12: error: use of undeclared identifier
'__builtin_ia32_vec_ext_v2si'
return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:129:19: error: use of undeclared identifier
'__builtin_ia32_packsswb'
return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:159:19: error: use of undeclared identifier
'__builtin_ia32_packssdw'
return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:189:19: error: use of undeclared identifier
'__builtin_ia32_packuswb'
return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:216:19: error: use of undeclared identifier
'__builtin_ia32_punpckhbw'
return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:239:19: error: use of undeclared identifier
'__builtin_ia32_punpckhwd'
return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:260:19: error: use of undeclared identifier
'__builtin_ia32_punpckhdq'
return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:287:19: error: use of undeclared identifier
'__builtin_ia32_punpcklbw'
return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:310:19: error: use of undeclared identifier
'__builtin_ia32_punpcklwd'
return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:331:19: error: use of undeclared identifier
'__builtin_ia32_punpckldq'
return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:352:19: error: use of undeclared identifier
'__builtin_ia32_paddb'
return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:373:19: error: use of undeclared identifier
'__builtin_ia32_paddw'
return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:394:19: error: use of undeclared identifier
'__builtin_ia32_paddd'
return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:416:19: error: use of undeclared identifier
'__builtin_ia32_paddsb'
return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:439:19: error: use of undeclared identifier
'__builtin_ia32_paddsw'
return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
emcc: error: 'C:/emsdk/upstream/bin\clang++.exe -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=19 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -D__SSE__=1 -D__SSE2__=1 -D__SSE3__=1 -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\libcxx -Xclang -isystemC:\emsdk\upstream\emscripten\system\lib\libcxxabi\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\lib\libunwind\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\compat -Xclang -isystemC:\emsdk\upstream\emscripten\system\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\libc -Xclang -isystemC:\emsdk\upstream\emscripten\system\lib\libc\musl\arch\emscripten -Xclang -isystemC:\emsdk\upstream\emscripten\system\local\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\SSE -Xclang -isystemC:\emsdk\upstream\emscripten\cache\wasm\include -DEMSCRIPTEN -fignore-exceptions -D__EMSCRIPTEN_PTHREADS__=1 -msimd128 -std=c++11 -O3 -I../dlib -I../opencv/build/include -pthread -pthread main.cpp -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\SDL -c -o C:\Users\Nitin\AppData\Local\Temp\emscripten_temp_l6l_woh0\main_0.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)
In file included from main.cpp:5:
In file included from ../dlib\dlib/image_processing/frontal_face_detector.h:8:
In file included from ../dlib\dlib/image_processing/../image_processing/scan_fhog_pyramid.h:8:
In file included from ../dlib\dlib/image_processing/../image_transforms.h:14:
In file included from ../dlib\dlib/image_processing/../image_transforms/spatial_filtering.h:13:
In file included from ../dlib\dlib/image_processing/../image_transforms/../simd.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd4f.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd_check.h:88:
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:13:19: error: typedef redefinition with different types
('__attribute__((__vector_size__(1 * sizeof(long long)))) long long' (vector of 1 'long long' value) vs
'__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values))
typedef long long __m64 __attribute__((__vector_size__(8), __aligned__(8)));
^
C:\emsdk\upstream\emscripten\system\include\SSE\xmmintrin.h:22:15: note: previous definition is here
typedef float __m64 __attribute__((__vector_size__(8), __aligned__(8)));
^
In file included from main.cpp:5:
In file included from ../dlib\dlib/image_processing/frontal_face_detector.h:8:
In file included from ../dlib\dlib/image_processing/../image_processing/scan_fhog_pyramid.h:8:
In file included from ../dlib\dlib/image_processing/../image_transforms.h:14:
In file included from ../dlib\dlib/image_processing/../image_transforms/spatial_filtering.h:13:
In file included from ../dlib\dlib/image_processing/../image_transforms/../simd.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd4f.h:6:
In file included from ../dlib\dlib/image_processing/../simd/simd_check.h:88:
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:33:5: error: use of undeclared identifier '__builtin_ia32_emms';
did you mean '__builtin_isless'?
__builtin_ia32_emms();
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:33:5: note: '__builtin_isless' declared here
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:33:25: error: too few arguments to function call, expected 2,
have 0
__builtin_ia32_emms();
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:50:19: error: use of undeclared identifier
'__builtin_ia32_vec_init_v2si'
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:67:12: error: use of undeclared identifier
'__builtin_ia32_vec_ext_v2si'
return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:129:19: error: use of undeclared identifier
'__builtin_ia32_packsswb'
return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:159:19: error: use of undeclared identifier
'__builtin_ia32_packssdw'
return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:189:19: error: use of undeclared identifier
'__builtin_ia32_packuswb'
return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:216:19: error: use of undeclared identifier
'__builtin_ia32_punpckhbw'
return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:239:19: error: use of undeclared identifier
'__builtin_ia32_punpckhwd'
return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:260:19: error: use of undeclared identifier
'__builtin_ia32_punpckhdq'
return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:287:19: error: use of undeclared identifier
'__builtin_ia32_punpcklbw'
return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:310:19: error: use of undeclared identifier
'__builtin_ia32_punpcklwd'
return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:331:19: error: use of undeclared identifier
'__builtin_ia32_punpckldq'
return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:352:19: error: use of undeclared identifier
'__builtin_ia32_paddb'
return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:373:19: error: use of undeclared identifier
'__builtin_ia32_paddw'
return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:394:19: error: use of undeclared identifier
'__builtin_ia32_paddd'
return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:416:19: error: use of undeclared identifier
'__builtin_ia32_paddsb'
return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
^
C:\emsdk\upstream\lib\clang\11.0.0\include\mmintrin.h:439:19: error: use of undeclared identifier
'__builtin_ia32_paddsw'
return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
emcc: error: 'C:/emsdk/upstream/bin\clang++.exe -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=19 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -D__SSE__=1 -D__SSE2__=1 -D__SSE3__=1 -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\libcxx -Xclang -isystemC:\emsdk\upstream\emscripten\system\lib\libcxxabi\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\lib\libunwind\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\compat -Xclang -isystemC:\emsdk\upstream\emscripten\system\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\libc -Xclang -isystemC:\emsdk\upstream\emscripten\system\lib\libc\musl\arch\emscripten -Xclang -isystemC:\emsdk\upstream\emscripten\system\local\include -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\SSE -Xclang -isystemC:\emsdk\upstream\emscripten\cache\wasm\include -DEMSCRIPTEN -fignore-exceptions -D__EMSCRIPTEN_PTHREADS__=1 -msimd128 -std=c++11 -O3 -I../dlib -I../opencv/build/include -pthread -pthread main.cpp -Xclang -isystemC:\emsdk\upstream\emscripten\system\include\SDL -c -o C:\Users\Nitin\AppData\Local\Temp\emscripten_temp_l6l_woh0\main_0.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)
Aucun commentaire:
Enregistrer un commentaire