You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to build a dynamic library using libmaix but I cannot.
I want to build libZMQ library,
I copied the hello_world example in libmaix, I have put al sources in main/src and includes in main/include
I have added to /libmaix/examples/libzmq/main/CMakeLists.txt
list(APPEND ADD_DEFINITIONS -fPIC)
and register_component(SHARED)
I see in the logs that compile.cmake has activated to_dynamic_lib flag.
But, after compiling everything, it ends with the following error:
.....
[ 95%] Building CXX object main/CMakeFiles/main.dir/src/zmq_utils.cpp.o
[ 96%] Building CXX object main/CMakeFiles/main.dir/src/zmtp_engine.cpp.o
[ 97%] Linking CXX shared library libmain.so
[ 97%] Built target main
Scanning dependencies of target libzmq
[ 98%] Building C object CMakeFiles/libzmq.dir/exe_src.c.o
[ 99%] Linking C executable libzmq
/opt/toolchain-sunxi-musl/toolchain/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/6.4.1/../../../../arm-openwrt-linux-muslgnueabi/lib/crt1.o: In function _start_c': /home/caiyongheng/tina/out/astar-parrot/compile_dir/toolchain/musl-1.1.16/crt/crt1.c:17: undefined reference to main'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/libzmq.dir/build.make:89: libzmq] Error 1
make[1]: *** [CMakeFiles/Makefile2:301: CMakeFiles/libzmq.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
....... CMakeLists.txt
The text was updated successfully, but these errors were encountered:
I am trying to build a dynamic library using libmaix but I cannot.
I want to build libZMQ library,
I copied the hello_world example in libmaix, I have put al sources in main/src and includes in main/include
I have added to /libmaix/examples/libzmq/main/CMakeLists.txt
list(APPEND ADD_DEFINITIONS -fPIC)
and register_component(SHARED)
I see in the logs that compile.cmake has activated to_dynamic_lib flag.
But, after compiling everything, it ends with the following error:
.....
[ 95%] Building CXX object main/CMakeFiles/main.dir/src/zmq_utils.cpp.o
[ 96%] Building CXX object main/CMakeFiles/main.dir/src/zmtp_engine.cpp.o
[ 97%] Linking CXX shared library libmain.so
[ 97%] Built target main
Scanning dependencies of target libzmq
[ 98%] Building C object CMakeFiles/libzmq.dir/exe_src.c.o
[ 99%] Linking C executable libzmq
/opt/toolchain-sunxi-musl/toolchain/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/6.4.1/../../../../arm-openwrt-linux-muslgnueabi/lib/crt1.o: In function
_start_c': /home/caiyongheng/tina/out/astar-parrot/compile_dir/toolchain/musl-1.1.16/crt/crt1.c:17: undefined reference to
main'collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/libzmq.dir/build.make:89: libzmq] Error 1
make[1]: *** [CMakeFiles/Makefile2:301: CMakeFiles/libzmq.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
.......
CMakeLists.txt
The text was updated successfully, but these errors were encountered: