Score:0

Cmake cannot work Conan GTest on Ubuntu

ru flag

I've created a very simple code for GTest using Conan: https://github.com/FTamas77/Demo On a host there is a Windows, I installed the Conan package and everything works fine. I've create an Ubuntu running on VMware. I installed everything. Without Conan it works. So, there is no problem with the environment. The problem with GTest Conan doesn't work on Linux, at least on this way.

I checked the variables and those are OK. Furthemore, the intellicense works fine too. CMake config also works fine. Compile time error I have.But the file is there.

If it wouldn't enough, last time, I can get over this and a libs was missing during compile time. I also checked the conan variables and everything seems to be fine.

The ubuntu is new and everything is lates. I'm using Visual Studio 2022 Enterprise. What difference can be Linux and Windows? rsync work fine...

Could you please give me hint? I remember, I has to patch Gtest, but of course, I forget it. :-(

This is the Linux output on Windows:

Starting copying files to remote machine.

[rsync] rsync -t --delete -v -r -8 "." rsync://aiis@localhost:62722/-home-aiis-Devel-Demo-src [rsync] sending incremental file list [rsync] deleting out/build/Linux-GCC-Debug/.cmake/api/v1/reply/target-sourceCodeTest-Debug-697ed8159b9694d2ebb9.json [rsync] deleting out/build/Linux-GCC-Debug/.cmake/api/v1/reply/target-DEMO-Debug-2bbac32efc2c02594213.json [rsync] deleting out/build/Linux-GCC-Debug/.cmake/api/v1/reply/index-2021-12-12T19-05-42-0889.json [rsync] deleting out/build/Linux-GCC-Debug/.cmake/api/v1/reply/codemodel-v2-d2d16811fb182e16f5a0.json [rsync] deleting out/build/Linux-GCC-Debug/.cmake/api/v1/reply/cmakeFiles-v1-d91bf58d33fd5c1b5467.json [rsync] .vs/ [rsync] .vs/-801582710.scan.fgp [rsync] .vs/.scan.fgp [rsync] .vs/slnx.sqlite [rsync] .vs/Demo/v17/.suo [rsync] .vs/Demo/v17/Preview/Browse.VC.db [rsync] .vs/Demo/v17/Preview/Browse.VC.db-wal [rsync] out/build/Linux-GCC-Debug/ [rsync] out/build/Linux-GCC-Debug/.cmake/api/v1/reply/ [rsync] out/build/Linux-GCC-Debug/.cmake/api/v1/reply/cmakeFiles-v1-681274e1a202809c73fc.json [rsync] out/build/Linux-GCC-Debug/.cmake/api/v1/reply/codemodel-v2-94ebad20ba3de9a12a14.json [rsync] out/build/Linux-GCC-Debug/.cmake/api/v1/reply/index-2021-12-12T19-13-16-0536.json [rsync] out/build/Linux-GCC-Debug/.cmake/api/v1/reply/target-DEMO-Debug-8723d07218b4d56adb89.json [rsync] out/build/Linux-GCC-Debug/.cmake/api/v1/reply/target-sourceCodeTest-Debug-649c40c61c4fc918eece.json [rsync] out/build/Linux-GCC-Debug/isenseconfig/iconfig.json [rsync] [rsync] sent 210,018 bytes received 37,176 bytes 98,877.60 bytes/sec [rsync] total size is 276,789,021 speedup is 1,119.72 Finished copying files (elapsed time 00h:00m:03s:005ms). cd ~/Devel/Demo-build/;/usr/bin/cmake --build ~/Devel/Demo-build/ --clean-first --config Debug;

[1/1] Cleaning all built files... Cleaning... 1 files. [1/4] Building CXX object CMakeFiles/sourceCodeTest.dir/sourceCodeTest.cpp.o FAILED: CMakeFiles/sourceCodeTest.dir/sourceCodeTest.cpp.o /usr/bin/c++ -I/home/aiis/Devel/Demo-src -I"/home/aiis/Devel/Demo-src/C:/Users/Fekete Tamas/.conan/data/gtest/1.10.0///package/875c67f4d8a79bdd002908b75efce119eb82836d/include" -I/home/aiis/Devel/Demo-src/sourceCodeTest -I/home/aiis/Devel/Demo-src/PRIVATE_HEADER -g -MD -MT CMakeFiles/sourceCodeTest.dir/sourceCodeTest.cpp.o -MF CMakeFiles/sourceCodeTest.dir/sourceCodeTest.cpp.o.d -o CMakeFiles/sourceCodeTest.dir/sourceCodeTest.cpp.o -c /home/aiis/Devel/Demo-src/sourceCodeTest.cpp /home/aiis/Devel/Demo-src/sourceCodeTest.cpp:1:10: fatal error: gtest/gtest.h: No such file or directory 1 | #include <gtest/gtest.h> | ^~~~~~~~~~~~~~~ compilation terminated. [2/4] Building CXX object CMakeFiles/DEMO.dir/sourceCode.cpp.o ninja: build stopped: subcommand failed.

Rebuild All failed.

Last thing. Is it normal that I have a feeling that Windows want to use Windows build in Linux? It is strange me the lots of Windows path on Linux.

Knud Larsen avatar
by flag
? How about `sudo apt install libgtest-dev` https://packages.ubuntu.com/focal/amd64/libgtest-dev/filelist
Tamas avatar
ru flag
Sounds good. Thanks. But it would be better to use toolchain later. For example, I can write the came cmake for Windows and Linux.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.