#Struggling with libraries in c++ (mingw32-make, g++)

26 messages · Page 1 of 1 (latest)

turbid rampart
#

Hello, sorry if that's a stupid post , but I'm trying to install a library to simply read keyboard inputs and I've struggled for the last 4-5 hours already without any success... First I tried installing SDL and after like 1.5 hours I was able to figure out how to include all the headers and libraries I needed but was getting "-lmingw32 no such file or directory" while I'm pretty sure I had it installed (otherwise I would not be able to use mingw32-make to try building the code). So after that I tried using LInput (https://github.com/TheNicker/LInput), it says that its a header only library, but after a lot of struggling I still was not able to get it working, due to some random.. errors?... (Compiler did not render them as errors but still was unable to build) in RawInput class. And so now I'm trying to install the most basic headers only library I was able to find (https://github.com/martinRenou/terminal), only 2 files, no dependencies. And this time I cant even include the thing in the first place... I have the cpp-terminal folder in the includes in makefile yet it still cant see headers I want to include

fresh kernelBOT
#

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.

lament prism
#

You should use SDL2

#

The other two are some noname random libs I've never heard about

#

Can you please show the compiler command you tried, and the full error mesasge you got?

lament prism
hallow goblet
#

The include directory is the base path for your #includes. So if you specify -Icpp-termianal you need to #include <terminal.h> in order to include cpp-termianal\terminal.h.

turbid rampart
hallow goblet
#

Anyway you would be better off using Visual studio to be honest.

lament prism
#

Then SDL2 won't work...

turbid rampart
hallow goblet
#

Well apparently your directory is named cpp-terminal and not cpp-termianal.

lament prism
#

terminal vs termianal, lol

#

Nice typo

hallow goblet
#

I assumed it was another language or something LUL.

turbid rampart
#

AAAH, I was rewriting this include several times and apparently made a typo just before making a post haha, well, fixing it I still get the error... Although it's now related to the terminal.h file.. I'm guessing I'll have to change the terminal-base include inside the terminal.h file as well?

PS C:\Users\Limofeus\Desktop\VScodiumTest\BETTERTESTSHIT\CPPCONSOLESTRINGTEST1> mingw32-make
g++ -o main main.cpp -I cpp-terminal -Wall -Wextra
main.cpp:2:10: fatal error: cpp-terminal/terminal.h: No such file or directory
    2 | #include <cpp-terminal/terminal.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:2: recipe for target 'all' failed
mingw32-make: *** [all] Error 1
PS C:\Users\Limofeus\Desktop\VScodiumTest\BETTERTESTSHIT\CPPCONSOLESTRINGTEST1> mingw32-make
g++ -o main main.cpp -I cpp-terminal -Wall -Wextra
In file included from main.cpp:2:
cpp-terminal/terminal.h:16:10: fatal error: cpp-terminal/terminal_base.h: No such file or directory
   16 | #include <cpp-terminal/terminal_base.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:2: recipe for target 'all' failed
mingw32-make: *** [all] Error 1
turbid rampart
lament prism
#

Nvm I'm dumb

#

You don't need to modify it. You should use -I. instead of -Icpp-terminal, and then #include <cpp-terminal/terminal.h>

#

Also, what kind of input do you want to read with those libs? What can't you do with just the standard library?

turbid rampart
#

Okay, the thing seems to build fine now and library functions are working

lament prism
#

This sounds like a job for _kbhit() from <conio.h>, don't need third-party libraries for this

turbid rampart
#

I just needed a multiplatform library, otherwise I'd use windows.h probably

lament prism
#

Ah

turbid rampart
#

!solved