Skip to content

Instantly share code, notes, and snippets.

@AlecTaylor
Last active August 29, 2015 13:55
Show Gist options
  • Save AlecTaylor/8783728 to your computer and use it in GitHub Desktop.
Save AlecTaylor/8783728 to your computer and use it in GitHub Desktop.
Troubleshooting adding CMake to node.native
project(node_native)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
include_directories(../node_native ../node_native/libuv/include ../node_native/http-parser)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/../node_native/libuv/libuv.a
COMMAND make
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../node_native/libuv)
add_custom_target(
libuv
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/../node_native/libuv/libuv.a)
add_dependencies(node_native libuv)
target_link_libraries(node_native ${CMAKE_CURRENT_SOURCE_DIR}/../node_native/libuv/libuv.a)
#Output of `cmake -g 'Unix Makefiles' ../node_native && make`
/usr/bin/cmake -H/home/alectaylor/Projects/node_native -B/home/alectaylor/Projects/node_native-build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/alectaylor/Projects/node_native-build/CMakeFiles /home/alectaylor/Projects/node_native-build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/alectaylor/Projects/node_native-build'
make -f CMakeFiles/libuv.dir/build.make CMakeFiles/libuv.dir/depend
make[2]: Entering directory `/home/alectaylor/Projects/node_native-build'
cd /home/alectaylor/Projects/node_native-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/alectaylor/Projects/node_native /home/alectaylor/Projects/node_native /home/alectaylor/Projects/node_native-build /home/alectaylor/Projects/node_native-build /home/alectaylor/Projects/node_native-build/CMakeFiles/libuv.dir/DependInfo.cmake --color=
Dependee "/home/alectaylor/Projects/node_native-build/CMakeFiles/libuv.dir/DependInfo.cmake" is newer than depender "/home/alectaylor/Projects/node_native-build/CMakeFiles/libuv.dir/depend.internal".
Dependee "/home/alectaylor/Projects/node_native-build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/alectaylor/Projects/node_native-build/CMakeFiles/libuv.dir/depend.internal".
Scanning dependencies of target libuv
make[2]: Leaving directory `/home/alectaylor/Projects/node_native-build'
make -f CMakeFiles/libuv.dir/build.make CMakeFiles/libuv.dir/build
make[2]: Entering directory `/home/alectaylor/Projects/node_native-build'
make[2]: Nothing to be done for `CMakeFiles/libuv.dir/build'.
make[2]: Leaving directory `/home/alectaylor/Projects/node_native-build'
/usr/bin/cmake -E cmake_progress_report /home/alectaylor/Projects/node_native-build/CMakeFiles 1
[ 20%] Built target libuv
make -f CMakeFiles/node_native.dir/build.make CMakeFiles/node_native.dir/depend
make[2]: Entering directory `/home/alectaylor/Projects/node_native-build'
cd /home/alectaylor/Projects/node_native-build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/alectaylor/Projects/node_native /home/alectaylor/Projects/node_native /home/alectaylor/Projects/node_native-build /home/alectaylor/Projects/node_native-build /home/alectaylor/Projects/node_native-build/CMakeFiles/node_native.dir/DependInfo.cmake --color=
Dependee "/home/alectaylor/Projects/node_native-build/CMakeFiles/node_native.dir/DependInfo.cmake" is newer than depender "/home/alectaylor/Projects/node_native-build/CMakeFiles/node_native.dir/depend.internal".
Dependee "/home/alectaylor/Projects/node_native-build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/alectaylor/Projects/node_native-build/CMakeFiles/node_native.dir/depend.internal".
Scanning dependencies of target node_native
make[2]: Leaving directory `/home/alectaylor/Projects/node_native-build'
make -f CMakeFiles/node_native.dir/build.make CMakeFiles/node_native.dir/build
make[2]: Entering directory `/home/alectaylor/Projects/node_native-build'
/usr/bin/cmake -E cmake_progress_report /home/alectaylor/Projects/node_native-build/CMakeFiles 2
[ 40%] Building CXX object CMakeFiles/node_native.dir/file_test.cpp.o
/usr/bin/c++ -std=c++11 -I/home/alectaylor/Projects/node_native/../node_native -I/home/alectaylor/Projects/node_native/../node_native/libuv/include -I/home/alectaylor/Projects/node_native/../node_native/http-parser -o CMakeFiles/node_native.dir/file_test.cpp.o -c /home/alectaylor/Projects/node_native/file_test.cpp
/usr/bin/cmake -E cmake_progress_report /home/alectaylor/Projects/node_native-build/CMakeFiles 3
[ 60%] Building CXX object CMakeFiles/node_native.dir/main.cpp.o
/usr/bin/c++ -std=c++11 -I/home/alectaylor/Projects/node_native/../node_native -I/home/alectaylor/Projects/node_native/../node_native/libuv/include -I/home/alectaylor/Projects/node_native/../node_native/http-parser -o CMakeFiles/node_native.dir/main.cpp.o -c /home/alectaylor/Projects/node_native/main.cpp
/usr/bin/cmake -E cmake_progress_report /home/alectaylor/Projects/node_native-build/CMakeFiles 4
[ 80%] Building CXX object CMakeFiles/node_native.dir/webclient.cpp.o
/usr/bin/c++ -std=c++11 -I/home/alectaylor/Projects/node_native/../node_native -I/home/alectaylor/Projects/node_native/../node_native/libuv/include -I/home/alectaylor/Projects/node_native/../node_native/http-parser -o CMakeFiles/node_native.dir/webclient.cpp.o -c /home/alectaylor/Projects/node_native/webclient.cpp
/usr/bin/cmake -E cmake_progress_report /home/alectaylor/Projects/node_native-build/CMakeFiles 5
[100%] Building CXX object CMakeFiles/node_native.dir/webserver.cpp.o
/usr/bin/c++ -std=c++11 -I/home/alectaylor/Projects/node_native/../node_native -I/home/alectaylor/Projects/node_native/../node_native/libuv/include -I/home/alectaylor/Projects/node_native/../node_native/http-parser -o CMakeFiles/node_native.dir/webserver.cpp.o -c /home/alectaylor/Projects/node_native/webserver.cpp
Linking CXX executable node_native
/usr/bin/cmake -E cmake_link_script CMakeFiles/node_native.dir/link.txt --verbose=1
/usr/bin/c++ -std=c++11 CMakeFiles/node_native.dir/file_test.cpp.o CMakeFiles/node_native.dir/main.cpp.o CMakeFiles/node_native.dir/webclient.cpp.o CMakeFiles/node_native.dir/webserver.cpp.o -o node_native -rdynamic /home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a
CMakeFiles/node_native.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x19dc): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::get_last_error()':
webclient.cpp:(.text+0x113): multiple definition of `native::get_last_error()'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x9b): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::run()':
webclient.cpp:(.text+0x140): multiple definition of `native::run()'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xc8): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::run_once()':
webclient.cpp:(.text+0x158): multiple definition of `native::run_once()'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xe0): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::base::_delete_handle(uv_handle_s*)':
webclient.cpp:(.text+0x170): multiple definition of `native::base::_delete_handle(uv_handle_s*)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xf8): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::net::to_ip4_addr(std::string const&, int)':
webclient.cpp:(.text+0x20d): multiple definition of `native::net::to_ip4_addr(std::string const&, int)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x195): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::net::to_ip6_addr(std::string const&, int)':
webclient.cpp:(.text+0x237): multiple definition of `native::net::to_ip6_addr(std::string const&, int)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1bf): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::net::from_ip4_addr(sockaddr_in*, std::string&, int&)':
webclient.cpp:(.text+0x271): multiple definition of `native::net::from_ip4_addr(sockaddr_in*, std::string&, int&)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1f9): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::net::from_ip6_addr(sockaddr_in6*, std::string&, int&)':
webclient.cpp:(.text+0x315): multiple definition of `native::net::from_ip6_addr(sockaddr_in6*, std::string&, int&)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x29d): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::http::get_error_name(http_errno)':
webclient.cpp:(.text+0x3b9): multiple definition of `native::http::get_error_name(http_errno)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x341): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::http::get_error_description(http_errno)':
webclient.cpp:(.text+0x3d0): multiple definition of `native::http::get_error_description(http_errno)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x358): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::http::get_method_name(http_method)':
webclient.cpp:(.text+0x3e7): multiple definition of `native::http::get_method_name(http_method)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x36f): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::internal::delete_req(uv_fs_s*)':
webclient.cpp:(.text+0x3fe): multiple definition of `native::fs::internal::delete_req(uv_fs_s*)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x386): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::open(std::string const&, int, int, std::function<void (int, native::error)>)':
webclient.cpp:(.text+0x54d): multiple definition of `native::fs::open(std::string const&, int, int, std::function<void (int, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x4d5): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::read(int, unsigned long, long, std::function<void (std::string const&, native::error)>)':
webclient.cpp:(.text+0x843): multiple definition of `native::fs::read(int, unsigned long, long, std::function<void (std::string const&, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x7cb): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::write(int, char const*, unsigned long, long, std::function<void (int, native::error)>)':
webclient.cpp:(.text+0xa3b): multiple definition of `native::fs::write(int, char const*, unsigned long, long, std::function<void (int, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x9c3): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::read_to_end(int, std::function<void (std::string const&, native::error)>)':
webclient.cpp:(.text+0xb33): multiple definition of `native::fs::read_to_end(int, std::function<void (std::string const&, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xabb): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::close(int, std::function<void (native::error)>)':
webclient.cpp:(.text+0xd0d): multiple definition of `native::fs::close(int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xc95): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::unlink(std::string const&, std::function<void (native::error)>)':
webclient.cpp:(.text+0xea3): multiple definition of `native::fs::unlink(std::string const&, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xe2b): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::mkdir(std::string const&, int, std::function<void (native::error)>)':
webclient.cpp:(.text+0x104d): multiple definition of `native::fs::mkdir(std::string const&, int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xfd5): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::rmdir(std::string const&, std::function<void (native::error)>)':
webclient.cpp:(.text+0x11ff): multiple definition of `native::fs::rmdir(std::string const&, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1187): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::rename(std::string const&, std::string const&, std::function<void (native::error)>)':
webclient.cpp:(.text+0x13a9): multiple definition of `native::fs::rename(std::string const&, std::string const&, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1331): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::chmod(std::string const&, int, std::function<void (native::error)>)':
webclient.cpp:(.text+0x156d): multiple definition of `native::fs::chmod(std::string const&, int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x14f5): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::fs::chown(std::string const&, int, int, std::function<void (native::error)>)':
webclient.cpp:(.text+0x171f): multiple definition of `native::fs::chown(std::string const&, int, int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x16a7): first defined here
CMakeFiles/node_native.dir/webclient.cpp.o: In function `main':
webclient.cpp:(.text+0x1ca3): multiple definition of `main'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x19dc): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::get_last_error()':
webserver.cpp:(.text+0x9b): multiple definition of `native::get_last_error()'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x9b): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::run()':
webserver.cpp:(.text+0xc8): multiple definition of `native::run()'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xc8): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::run_once()':
webserver.cpp:(.text+0xe0): multiple definition of `native::run_once()'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xe0): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::base::_delete_handle(uv_handle_s*)':
webserver.cpp:(.text+0xf8): multiple definition of `native::base::_delete_handle(uv_handle_s*)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xf8): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::net::to_ip4_addr(std::string const&, int)':
webserver.cpp:(.text+0x195): multiple definition of `native::net::to_ip4_addr(std::string const&, int)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x195): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::net::to_ip6_addr(std::string const&, int)':
webserver.cpp:(.text+0x1bf): multiple definition of `native::net::to_ip6_addr(std::string const&, int)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1bf): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::net::from_ip4_addr(sockaddr_in*, std::string&, int&)':
webserver.cpp:(.text+0x1f9): multiple definition of `native::net::from_ip4_addr(sockaddr_in*, std::string&, int&)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1f9): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::net::from_ip6_addr(sockaddr_in6*, std::string&, int&)':
webserver.cpp:(.text+0x29d): multiple definition of `native::net::from_ip6_addr(sockaddr_in6*, std::string&, int&)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x29d): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::get_error_name(http_errno)':
webserver.cpp:(.text+0x341): multiple definition of `native::http::get_error_name(http_errno)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x341): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::get_error_description(http_errno)':
webserver.cpp:(.text+0x358): multiple definition of `native::http::get_error_description(http_errno)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x358): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::get_method_name(http_method)':
webserver.cpp:(.text+0x36f): multiple definition of `native::http::get_method_name(http_method)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x36f): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::internal::delete_req(uv_fs_s*)':
webserver.cpp:(.text+0x386): multiple definition of `native::fs::internal::delete_req(uv_fs_s*)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x386): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::open(std::string const&, int, int, std::function<void (int, native::error)>)':
webserver.cpp:(.text+0x4d5): multiple definition of `native::fs::open(std::string const&, int, int, std::function<void (int, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x4d5): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::read(int, unsigned long, long, std::function<void (std::string const&, native::error)>)':
webserver.cpp:(.text+0x7cb): multiple definition of `native::fs::read(int, unsigned long, long, std::function<void (std::string const&, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x7cb): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::write(int, char const*, unsigned long, long, std::function<void (int, native::error)>)':
webserver.cpp:(.text+0x9c3): multiple definition of `native::fs::write(int, char const*, unsigned long, long, std::function<void (int, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x9c3): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::read_to_end(int, std::function<void (std::string const&, native::error)>)':
webserver.cpp:(.text+0xabb): multiple definition of `native::fs::read_to_end(int, std::function<void (std::string const&, native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xabb): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::close(int, std::function<void (native::error)>)':
webserver.cpp:(.text+0xc95): multiple definition of `native::fs::close(int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xc95): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::unlink(std::string const&, std::function<void (native::error)>)':
webserver.cpp:(.text+0xe2b): multiple definition of `native::fs::unlink(std::string const&, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xe2b): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::mkdir(std::string const&, int, std::function<void (native::error)>)':
webserver.cpp:(.text+0xfd5): multiple definition of `native::fs::mkdir(std::string const&, int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0xfd5): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::rmdir(std::string const&, std::function<void (native::error)>)':
webserver.cpp:(.text+0x1187): multiple definition of `native::fs::rmdir(std::string const&, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1187): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::rename(std::string const&, std::string const&, std::function<void (native::error)>)':
webserver.cpp:(.text+0x1331): multiple definition of `native::fs::rename(std::string const&, std::string const&, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x1331): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::chmod(std::string const&, int, std::function<void (native::error)>)':
webserver.cpp:(.text+0x14f5): multiple definition of `native::fs::chmod(std::string const&, int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x14f5): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::fs::chown(std::string const&, int, int, std::function<void (native::error)>)':
webserver.cpp:(.text+0x16a7): multiple definition of `native::fs::chown(std::string const&, int, int, std::function<void (native::error)>)'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x16a7): first defined here
CMakeFiles/node_native.dir/webserver.cpp.o: In function `main':
webserver.cpp:(.text+0x1941): multiple definition of `main'
CMakeFiles/node_native.dir/file_test.cpp.o:file_test.cpp:(.text+0x19dc): first defined here
CMakeFiles/node_native.dir/file_test.cpp.o: In function `native::http::get_error_name(http_errno)':
file_test.cpp:(.text+0x352): undefined reference to `http_errno_name'
CMakeFiles/node_native.dir/file_test.cpp.o: In function `native::http::get_error_description(http_errno)':
file_test.cpp:(.text+0x369): undefined reference to `http_errno_description'
CMakeFiles/node_native.dir/file_test.cpp.o: In function `native::http::get_method_name(http_method)':
file_test.cpp:(.text+0x380): undefined reference to `http_method_str'
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::http::get_error_name(http_errno)':
webclient.cpp:(.text+0x3ca): undefined reference to `http_errno_name'
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::http::get_error_description(http_errno)':
webclient.cpp:(.text+0x3e1): undefined reference to `http_errno_description'
CMakeFiles/node_native.dir/webclient.cpp.o: In function `native::http::get_method_name(http_method)':
webclient.cpp:(.text+0x3f8): undefined reference to `http_method_str'
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::get_error_name(http_errno)':
webserver.cpp:(.text+0x352): undefined reference to `http_errno_name'
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::get_error_description(http_errno)':
webserver.cpp:(.text+0x369): undefined reference to `http_errno_description'
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::get_method_name(http_method)':
webserver.cpp:(.text+0x380): undefined reference to `http_method_str'
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::url_obj::from_buf(char const*, unsigned long, bool)':
webserver.cpp:(.text._ZN6native4http7url_obj8from_bufEPKcmb[_ZN6native4http7url_obj8from_bufEPKcmb]+0x83): undefined reference to `http_parser_parse_url'
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::client_context::parse(std::function<void (native::http::request&, native::http::response&)>)::{lambda(char const*, int)#7}::operator()(char const*, int) const':
webserver.cpp:(.text._ZZN6native4http14client_context5parseESt8functionIFvRNS0_7requestERNS0_8responseEEEENKUlPKciE5_clESA_i[_ZZN6native4http14client_context5parseESt8functionIFvRNS0_7requestERNS0_8responseEEEENKUlPKciE5_clESA_i]+0x5d): undefined reference to `http_parser_execute'
CMakeFiles/node_native.dir/webserver.cpp.o: In function `native::http::client_context::parse(std::function<void (native::http::request&, native::http::response&)>)':
webserver.cpp:(.text._ZN6native4http14client_context5parseESt8functionIFvRNS0_7requestERNS0_8responseEEE[_ZN6native4http14client_context5parseESt8functionIFvRNS0_7requestERNS0_8responseEEE]+0x8c): undefined reference to `http_parser_init'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(signal.o): In function `uv__signal_global_once_init':
/home/alectaylor/Projects/node_native/libuv/src/unix/signal.c:67: undefined reference to `pthread_once'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(signal.o): In function `uv__signal_block_and_lock':
/home/alectaylor/Projects/node_native/libuv/src/unix/signal.c:102: undefined reference to `pthread_sigmask'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(signal.o): In function `uv__signal_unlock_and_unblock':
/home/alectaylor/Projects/node_native/libuv/src/unix/signal.c:114: undefined reference to `pthread_sigmask'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_thread_join':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:37: undefined reference to `pthread_join'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_mutex_init':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:54: undefined reference to `pthread_mutexattr_init'
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:57: undefined reference to `pthread_mutexattr_settype'
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:62: undefined reference to `pthread_mutexattr_destroy'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_mutex_trylock':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:85: undefined reference to `pthread_mutex_trylock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_init':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:104: undefined reference to `pthread_rwlock_init'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_destroy':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:112: undefined reference to `pthread_rwlock_destroy'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_rdlock':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:118: undefined reference to `pthread_rwlock_rdlock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_tryrdlock':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:126: undefined reference to `pthread_rwlock_tryrdlock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_rdunlock':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:139: undefined reference to `pthread_rwlock_unlock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_wrlock':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:145: undefined reference to `pthread_rwlock_wrlock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_trywrlock':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:153: undefined reference to `pthread_rwlock_trywrlock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_rwlock_wrunlock':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:166: undefined reference to `pthread_rwlock_unlock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_once':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:172: undefined reference to `pthread_once'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_sem_init':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:225: undefined reference to `sem_init'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_sem_destroy':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:230: undefined reference to `sem_destroy'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_sem_post':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:236: undefined reference to `sem_post'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_sem_wait':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:245: undefined reference to `sem_wait'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_sem_trywait':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:257: undefined reference to `sem_trywait'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_cond_init':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:286: undefined reference to `pthread_condattr_setclock'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_barrier_init':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:433: undefined reference to `pthread_barrier_init'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_barrier_destroy':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:441: undefined reference to `pthread_barrier_destroy'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(thread.o): In function `uv_barrier_wait':
/home/alectaylor/Projects/node_native/libuv/src/unix/thread.c:447: undefined reference to `pthread_barrier_wait'
/home/alectaylor/Projects/node_native/../node_native/libuv/libuv.a(uv-common.o): In function `uv_thread_create':
/home/alectaylor/Projects/node_native/libuv/src/uv-common.c:307: undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[2]: *** [node_native] Error 1
make[2]: Leaving directory `/home/alectaylor/Projects/node_native-build'
make[1]: *** [CMakeFiles/node_native.dir/all] Error 2
make[1]: Leaving directory `/home/alectaylor/Projects/node_native-build'
make: *** [all] Error 2
#!/usr/bin/env bash
git clone https://github.com/d5/node.native node_native
cd node_native
git submodule update --init
mkdir ../node_native-build && cd ../node_native-build
cmake -g 'Unix Makefiles' ../node_native-build
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment