I'm trying to build my EOS smart contract using eosio.cdt and via cmake.
Compilation succeeded, but linking failed with below log.
/usr/local/eosio.cdt/bin/wasm-ld: error: locale.cpp.o: undefined symbol: strftime_l
/usr/local/eosio.cdt/bin/wasm-ld: error: memory.cpp.o: undefined symbol: __cxa_pure_virtual
/usr/local/eosio.cdt/bin/wasm-ld: error: system_error.cpp.o: undefined symbol: __cxa_pure_virtual
The code for linking module generated by cmake is as below.
eosio-ld -L=/usr/local/eosio.cdt/lib/ CMakeFiles/a.wasm.dir/a.cpp.o CMakeFiles/a.wasm.dir/validator/b.cpp.o CMakeFiles/a.wasm.dir/validator/c.cpp.o CMakeFiles/a.wasm.dir/common/d.cpp.o -o a.wasm
libc++.a exists in /usr/local/eosio.cdt/lib/.
How can I fix this problem?
Just include <eosiolib/eosio.hpp> header file.
Related
I am suddenly getting the follow errors and I have no clue how to fix them:
Object
loc: "1224:2-26"
message: "Module not found: Error: Can't resolve './iterator.js' in 'C:\\Users\\MyApp\\node_modules\\vega-embed\\build'"
moduleIdentifier: "C:\\Users\\MyApp\\node_modules\\#angular-devkit\\build-angular\\src\\babel\\webpack-loader.js??ruleSet[1].rules[2].use[0]!C:\\Users\\my-project\\node_modules\\#ngtools\\webpack\\src\\ivy\\index.js!C:\\Users\\MyApp\\node_modules\\source-map-loader\\dist\\cjs.js??ruleSet[1].rules[3]!C:\\Users\\MyApp\\node_modules\\vega-embed\\build\\vega-embed.module.js"
moduleName: "./node_modules/vega-embed/build/vega-embed.module.js"
[[Prototype]]: Object
./node_modules/vega-embed/build/vega-embed.module.js:1224:2-26 - Warning: Module not found: Error: Can't resolve './iterator.js' in 'C:\Users\MyApp\node_modules\vega-embed\build'
I also get the following warning when I build my app:
Warning: C:\Users\MyApp\src\app\components\vega\vega.component.ts depends on 'vega-embed'. CommonJS or AMD dependencies can cause optimization bailouts.
Can someone please help me understand what is wrong and how I can resolve fix these?
Envs: Ubuntu 18.04, Miniconda3, python=3.7(GCC=7.3.0), GCC -v (7.4.0)
The error occurs when I run the following command:
scons build/X86/gem5.opt -j8
The error is as follow:
[ LINK] -> X86/marshal
lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
scons: *** [build/X86/marshal] Error 1
scons: building terminated because of errors.
And I am wondering how to fix it.
I was trying to build an app via ./gradle bundlerelease
got an error everytime:
C:\Users\xxx\Desktop\app\node_modules\#react-native-firebase\app\android\src\reactnative\java\io\invertase\firebase\app\ReactNativeFirebaseAppInitProvider.java:25: error: cannot find symbol
BuildConfig.APPLICATION_ID + ".reactnativefirebaseappinitprovider";
^
symbol: variable APPLICATION_ID
location: class BuildConfig
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-firebase_app:compileReleaseJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Downgrad the gradle to 3.6.0 (in build.gradle) and rebuild the project.
classpath('com.android.tools.build:gradle:3.6.0')
I'm trying to add libconfig++ to my CMake project, but it still complains
Libconfig library is config++
...
CMakeFiles/CustomCamReaderTask.dir/acA2440-20gc_ConfigUtility.cc.o: undefined reference to symbol '_ZN13ConfigSection3getERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERl'
.../lib/libconfig.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Here is my CMakeLists.txt
find_package(PkgConfig)
pkg_check_modules(LIBCONFIG_PLUSPLUS libconfig++ REQUIRED)
add_executable(CustomCamReaderTask
CustomCamReaderTask.cc
acA2440-20gc_ConfigUtility.cc)
target_include_directories(CustomCamReaderTask
PRIVATE ${CMAKE_SOURCE_DIR}/src/include/Pylon5
/opt/pylon5/include)
message("Libconfig library is ${LIBCONFIG_PLUSPLUS_LIBRARIES}")
target_link_libraries(CustomCamReaderTask
${LIBCONFIG_PLUSPLUS_LIBRARIES}
${PYLON_LIBS}
task
imageUtility
${OPENCV_LIBRARIES})
link_directories(/opt/pylon5/lib64)
link_libraries(${LIBCONFIG_PLUSPLUS_LIBRARIES})
It seems to find config++, I linked the directory, linked the library, not sure what else is wrong..
I am trying to compile libfreenect2 from libfreenect2 and it turns out that when I run the make file after having done cmake CMakeLists.txt in step 5, I keep having the following errors:
Linking CXX executable /home/lex/libfreenect2/examples/protonect/bin/Protonect
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeQueryExtension'
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeGetGammaRampSize'
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeGetGammaRamp'
/home/lex/libfreenect2/examples/protonect/lib/libfreenect2.so: undefined reference to `XF86VidModeSetGammaRamp'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/lex/libfreenect2/examples/protonect/bin/Protonect] Error 1
make[1]: *** [CMakeFiles/Protonect.dir/all] Error 2
make: *** [all] Error 2
Does anyone have any idea on how to fix this?
Your program appears to depend upon libXxf86vm. You will need to add something like
-lXxf86vm
to the link command line. Be sure to install the development package. I am surprised the CMakeLists.txt did not have this.
Installing Mesa3D seems to fix my issue. It's something that probably had to do with the dependencies of libfreenect2 during the cmake installation.