Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cap'n'Proto binding for C++ fails to build on Windows #978

Closed
pavel-odintsov opened this issue Apr 2, 2023 · 5 comments
Closed

Cap'n'Proto binding for C++ fails to build on Windows #978

pavel-odintsov opened this issue Apr 2, 2023 · 5 comments

Comments

@pavel-odintsov
Copy link
Owner

Error:

[31/59] Build Cap'n'Proto binding for C++
FAILED: C:/Users/pavel/fastnetmon/src/simple_packet_capnp/simple_packet.capnp.c++
cmd.exe /C "cd /D C:\Users\pavel\fastnetmon\src\build && LD_LIBRARY_PATH= "PATH=C:\tools\msys64\mingw64\bin;C:\tools\msys64\usr\local\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\PowerShell\7;C:\Program Files\Google\Compute Engine\sysprep;C:\Program Files\Git\cmd;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Conan\conan;C:\Users\pavel\AppData\Local\Microsoft\WindowsApps;C:\Program Files\CMake\bin;C:\Program Files\Vim\vim90;C:\Users\pavel\vcpkg;C:\tools\msys64\;C:\tools\msys64\usr\bin\site_perl;C:\tools\msys64\usr\bin\vendor_perl;C:\tools\msys64\usr\bin\core_perl:/opt/fastnetmon-community/libraries/capnproto_0_8_0/bin" C:/tools/msys64/mingw64/bin/capnp.exe compile --output c++:C:/Users/pavel/fastnetmon/src/simple_packet_capnp --src-prefix=C:/Users/pavel/fastnetmon/src/simple_packet_capnp C:/Users/pavel/fastnetmon/src/simple_packet_capnp/simple_packet.capnp"
'LD_LIBRARY_PATH' is not recognized as an internal or external command,
operable program or batch file.
@pavel-odintsov
Copy link
Owner Author

Following fix worked just fine:

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d0fc204..18407dd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -255,7 +255,7 @@ endif()
 ADD_CUSTOM_COMMAND(
     OUTPUT ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp.c++
     DEPENDS ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp
-    COMMAND "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}" "PATH=$ENV{PATH}:${CAPNP_CUSTOM_INSTALL_PATH}/bin" ${CAPNP_BINARY} compile --output c++:${PROJECT_SOURCE_DIR}/simple_packet_capnp --src-prefix=${PROJECT_SOURCE_DIR}/simple_packet_capnp ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp
+    COMMAND ${CAPNP_BINARY} compile --output c++:${PROJECT_SOURCE_DIR}/simple_packet_capnp --src-prefix=${PROJECT_SOURCE_DIR}/simple_packet_capnp ${PROJECT_SOURCE_DIR}/simple_packet_capnp/simple_packet.capnp
     COMMENT "Build Cap'n'Proto binding for C++"
 )

@pavel-odintsov
Copy link
Owner Author

Well, Linux did not like it:

[ 17%] Linking CXX static library libpatricia.a
c++: no such plugin (executable should be 'capnpc-c++')
c++: plugin failed: exit code 1
make[2]: *** [CMakeFiles/simple_packet_capnp.dir/build.make:74: ../simple_packet_capnp/simple_packet.capnp.c++] Error 1
make[1]: *** [CMakeFiles/Makefile2:208: CMakeFiles/simple_packet_capnp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 17%] Built target patricia

@pavel-odintsov
Copy link
Owner Author

It did not work: aef1fb5

@pavel-odintsov
Copy link
Owner Author

Failed again. Life is sad.

@pavel-odintsov
Copy link
Owner Author

Whoa it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant