Ive been trying to include a library from github in cpp and for some reason it isn't working. Here is the repo ive been trying to include https://github.com/antelle/keyboard-auto-type?tab=readme-ov-file#installation
but i cant understand how to actually use the library.
#need help including library from github with cmake and fetchcontent, but it isn't working
82 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
here is my file structure
have you followed the Installation and Usage sections?
seems well documented
Ive copy pasted it into my cmakelists.txtr
here is all like whats in my project:
this is my fs:
it gives me this whenever it ry to run a simple hello world
idk what im doing wrong
i got the verison number right, the link right, and i think everything else right
when I built the project, the fetch content worked pretty well:
it got the whole git repo into the build/_deps/ folder
cmake and cpp look fine. you must have something configured wrong in vscode
hwo do i configure vscode?
You (basically) have to install the cmake-tools extension and run CMake Configure from the VSC command palette (CTRL/Cmd + Shift + P or F1)
I did that
I did that multiple times
Did it generate a build-commands.json in your build directory?
Probably it’s trying to use the Ninja generator and failing since it already has a makefile generator, the easiest path forward is to delete the build folder and reconfigure using the plugin
is that the same thing as build-comands
Yeah, that’s the one I meant, I always forget the exact name
yea i have that
In that case it’s probably the C++ extension’s error cache acting up again (it’s a supposedly fixed bug), you can try disabling it: https://code.visualstudio.com/docs/cpp/faq-cpp#_how-do-i-disable-the-intellisense-cache-ipch
that didn't relly do anythiung tho
im still getting the error
Can you try building it, it also caches build errors from when you build using the plugin (seems that way since the source is gcc)
wait
so like build with ctrl chift p build or cmake ..
?
There’s a tab on the left with the cmake logo, that’s the most sure way
i got this with the command pallet build option
it gives me the same output with the extension dashboard thingie
In that case, try enabling CMAKE_VERBOSE_MAKEFILE in your CMakeLists.txt using set(CMAKE_VERBOSE_MAKEFILE ON)
Since it seems like keyboard-auto-type isn’t ending up in your include paths
its still giving me the same error, can we manually include it?
I mena ive tried manually including it but i didn't know which file to include
could you try to make a simple main.cpp and makefilelists, and try to reproduce the problem on ur end?
i think we might be able to figure out the issue if its js my IDE or me js being stupid
Not right now, but I can in around 15 minutes
okay, I can wait 🙂
are you free now?
k
lmk if ur able to reproduce the error
It works for me out of the box, the only challenge I had was intalling the required packages for linux (I run everything in a docker container)
Though looking through the logs that you sent (which I couldn't open before on mobile), there seems to be a compatibility issue with your cmake generated script and your gcc
Can you try doing the set(CMAKE_VERBOSE_MAKEFILE ON) in CMakeLists.txt, and post the output, since it seems to be limited to the Windows version
I had that on the whole time
let me do that again then
Could you post the whole output, I just need to see the command it's running to get that error, since it seems like a config issue for Windows
sry abt that, I thought that was the whole output
There don't seem to be any issues with the build commands, the best advice I can give is to try and either clean-reconfigure, or try reinstalling/repairing mingw; or as a last resort trying to use the Visual Studio generator in place of the Makefile generator and using Visual Studio Community
do you think that visual studio community would be a better way to develop cpp code as a whole than vscode?
For beginners, absolutely, for myself, I usually use a custom VSCode + DevContainers setup since I often use other languages, and I'm mac based running linux stuff
oh okay, thanks for your suggestion! I've programmed in cpp in vscode, before (raylib), but I normally use js, and java, for my daily languages, so like im kind of mixed between vscode and visual studio
@glacial ore Has your question been resolved? If so, type !solved :)
hey
I've got vscode running, and it completes with no errors!
I mean visual studio
can't beat the VS debugger
yea i did that when I tried using raylib for cpp[
yea it was a pain to debug the code though lol
like nvim debuggers kinda suck if your config sucks as a whole
so it was kinda messy code