u/Constant_Fox_5534

How to make C/C++ libraries usable without directly copying the file in my project?

I have a question, about how i could manage to make a library that don't need to get the file copied into the user project, but he could just include the file just by using a bash installation script.

If this is still not clear to you, take an example of downloading a library via the "install" command.

Every files dont have to be copied into the user project, right? (for example when installing SDL2).

I wonder if it is something similar to the process of placing an executable into '/usr/bin'.

Thanks you for reading and please let me know if i didn't detail/explain clearly my situation.

reddit.com
u/Constant_Fox_5534 — 8 days ago

Hello, i just began assembly language today. I was confused with a few things, and, would like to know if i could get answers :

  • msg_len: equ $-msg i know equ is similar to define from C, but i don't understand the '$-msg' ? What does '$' and '-' mean in this case ? And do i need to create a variable for every texts and their length if i want to print something ?
  • rax, rdi, rsi, rdx are registers made for specific tasks? Because for now, i have only seen rax being used to call a syscall code, rdi specify file descriptor, rsi specify variable to print and rdx specify the length of the message i want to print.
  • mov i didn't really understand what this opcode do? do it move data into a destination?
  • And lastly, where can i find good ressources to learn the assembly language?

Thanks for reading. Answering all of the questions isn't necessary obviously.

reddit.com
u/Constant_Fox_5534 — 18 days ago

Hello,

I am very new to assembly, just to clarify.

So, i was learning assembly when i decided to see how i could transform my code into a bootable ISO file.

I tried running this command : dd if=~/test.asm of=~/image.iso

It did create the iso, but when i tried to run it in gnome boxe, i got the error "no volume descriptors".

Of course i know making an actual bootable iso file wouldn't have been that easy, but i want to know if there was any way to actually make one.

Thanks for reading, let me know if i didn't detail/clarify something enough.

reddit.com
u/Constant_Fox_5534 — 18 days ago

I am printing this ANSI code, when the user press the up arrow key :

`\033[A` , wish is supposed to go to the beginning of the previous line.

It does work, but it require me to toggle it 2 times and pressing enter so it can go to the beginning of the previous line.

This is very strange to me because i disabled canonical mode in my terminal.

Details:

Echo and canonical mode disabled using termios.

Tested in visual studio code terminal, then linux terminal.

If i explained badly, or forgot to include details, please tell me. Thanks for reading.

reddit.com
u/Constant_Fox_5534 — 21 days ago

I was making a small command for the linux terminal. i made it have a custom alias by putting it into /usr/bin, but now i want to know :

How do i git clone my file into a specific path (/usr/bin), so users can install my command without having to do everything themselves ? If i can't, are there any others alternative to install my file into the `/usr/bin` path of the user ?

Thanks for reading.

reddit.com
u/Constant_Fox_5534 — 23 days ago