Nik
🤡
Ludovic 'Archivist'
Yeah I plan to do that, problem is I don’t really know how I can make a basic memory allocation, since the one Linux uses is very complex and rn I want a very basic one enough to do simple things
The Linux memory allocation is not that complicated actually. You make a tree out of pairs of bits. Bit 1 set means in use, bit 2 means a child node is in use. Each child is half the memory of the parent. You make one of these for every contiguous space of memory. That is basically the entire thing
Leovan
Is it possible to create variable of different type depends on enum? I want to increase its lifetime to outside switch, but not to global: switch (type) { case 1: int x = 10; break; case 2: float x = 15; break; }
Leovan
std::variant
Is std::variant somehow affects performance?
Ludovic 'Archivist'
Is std::variant somehow affects performance?
Not in any way that would make it worse than your switch when compiled with optimization
Ya deway
Hi guys, I almost managed to complete my project, some finishing touches are missing. I currently have a problem with two different monitor resolutions and scaling factors. I'll explain. I have two computers where a real mouse is connected in the first while my Arduino zero is connected in the second (which will act as a mouse through its native USB port). The Arduino's job is simply to replicate the actions of the mouse on the PC1. The problem is that when I move the real mouse, the Arduino correctly replicates the movements but every now and then it "overshoots", in the sense that on PC1 I reach the edges with the pointer and while on PC2 I am for example halfway down the screen. I seem to have already converted the different resolutions correctly and have put an initial starting point for both mice, but he doesn't want to know anything about it
harmony5 🇺🇳 ⌤
Did you set pointer speed in both computers to be the same?
Ya deway
Did you set pointer speed in both computers to be the same?
Damm😳, should be the same but i Will check thanks. Maybe Is the lag? My Arduino recive coordinates from UDP packets
Ya deway
The Speed Is the same in both PC unfortunally
Ya deway
Can i send my Arduino code and my python code?
klimi
it probably won't do much good, this group is made for C/C++, But you can use the #ot group if you want
klimi
#ot
Rose
#ot
Offtopic discussions should be done in the C/C++ Offtopic group. Please take your discussion/questions there.
Rose
User Nik has 1/2 warnings; be careful! Reason: offtopic
Ya deway
You need to factor in the different screen dimensions
Yeah i do that but i still have problems, maybe Is delay between PC ---> Arduino trought UDP protocol
Ya deway
#ot
I cant access to It
Rose
User Mx has 1/2 warnings; be careful! Reason: Automated blocklist action, due to a match on: t.me/joinchat/*
Chat Boss
ㅤNicholas sent a huge message, it has been re-uploaded as a file
klimi
@nicholas389 I think it is because the type is char* in reality and that could cause it, but it is just a theory, I haven't done windows
Unknown
Hi
klimi
Hi
nohello.com
Roman
Hi
nometa.xyz
\Device\NUL
ㅤNicholas sent a huge message, it has been re-uploaded as a file
Did you already did some stuff and then view it? @nicholas389 . The struct member may uninitialized
John
How should I set the dylib search path on my macos? I tried -L/path/to/dylib in the makefile but it doesn't work. Currently I have to put every dylib file under my project folder.
John
adding "export LD_LIBRARY_PATH=/path/to/dylib" in the ~/.bash_profile doesn't work either...
John
Didn't MacOS use ZSH now?
Just tried ~/.zshrc and it still didn't work...
\Device\NUL
Just tried ~/.zshrc and it still didn't work...
https://stackoverflow.com/q/60126159/20957991
\Device\NUL
.bashrc ?
I said default MacOS shell is ZSH now, not Bash
Vlad
I said default MacOS shell is ZSH now, not Bash
Did he specify that he uses newest macos?
Vlad
I just don't get where this assumption comes from
Vlad
adding "export LD_LIBRARY_PATH=/path/to/dylib" in the ~/.bash_profile doesn't work either...
Also you will need to execute LD_LIBRARY_PATH=... in your terminal if you want the effect immediately and not after the reboot
John
Also you will need to execute LD_LIBRARY_PATH=... in your terminal if you want the effect immediately and not after the reboot
I did "source"d the files after modification, both bash and zsh, and "echo $LD_LIBRARY_PATH" showed what I wanted. However, during runtime, macos still won't look into the path I specified...
Vlad
during runtime of what?
Vlad
You program? Building?
John
of my compiled and linked excutable file
John
Yes
Vlad
Well that's a little bit of wishful thinking on your part that your program will see these
Vlad
How do you get the shell variable? Though getenv?
John
I simply added the dynamic library paths in my makefile through -L
John
There's no shell variable in my code...
Vlad
John
So you've made a define for your C code?
Actually it was just a sample code of "mysql-connector-c++", with only one .cc file. There are no macro involved, and no -D like parameters are specified in makefile
Vlad
If you don't use getenv, and don't use defines
Vlad
Magic?
John
By -L, maybe?
Vlad
-L is a linker flag. How is your program supposed to know anything about linker flags
Vlad
Maybe you mean that the linker is failing to link an executable?
John
The error was: "dyld: Library not loaded: libmysqlcppconn.7.dylib"
John
Reason: tried this folder and that folder(just not the folder in LD_LIBRARY_PATH or -L/path/to/dylib), no such dylib file
Vlad
What is in the makefile?
John
CC=g++ CFLAG=-std=c++11 -g INCLUDE=-I/usr/local/mysql-connector-c++-8.0.12/include LIBS = -L/usr/local/mysql-connector-c++-8.0.12/lib64 -lmysqlcppconn -lssl -lcrypto -lresolv TARGET=playground ${TARGET}: playground.cc ${CC} ${CFLAG} ${INCLUDE} playground.cc $(LIBS) -o ${TARGET} clean: rm -r *.dSYM rm ${TARGET}
John
I don't see LD_LIBRARY_PATH there, nor there's a linker command
Will -L and -l in ${LIBS} be enough to point out the location of the dylib files, so the files will be dynamically linked during runtime?
Vlad
g++ -c main.cc -o main.o
John
Does it mean: Step 1: compile the .cc to a object file. Step 2: link the object file and dylibs together to generate an executable file?
Vlad
$(CC) -c $(TARGET).cc -o $(TARGET).o $(CC) $(TARGET).o $(LINKER_FLAGS) $(LIBS) -o $(TARGET).elf
Vlad
Kind of like this
John
I understand, maybe I was trying to use dynamic library in a "static" way...
John
Thanks a lot
Unknown
Hi frds
CupCake
Hehe
klimi
Hi frds
nohello.com
с
Is it real to quickly (a few days) write a web site backend on C++ by adhering to some rules and with some framework?
SDAS
Have you guys ever use copilot?
SDAS
How do you think of it
Ludovic 'Archivist'
Is it real to quickly (a few days) write a web site backend on C++ by adhering to some rules and with some framework?
If you use something like drogon you can definitely make a back-end in a few hours
Damo
Hi
Damo
Can anyone send me c++ 11 and c++ 14 notes