Nik
🤡
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;
}
Danya🔥
Ludovic 'Archivist'
Leovan
std::variant
Is std::variant somehow affects performance?
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
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
Ya deway
klimi
#ot
Rose
#ot
Offtopic discussions should be done in the C/C++ Offtopic group. Please take your discussion/questions there.
Mx
Rose
User Nik has 1/2 warnings; be careful!
Reason:
offtopic
Ya deway
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
Roman
Roman
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...
\Device\NUL
Vlad
\Device\NUL
\Device\NUL
.bashrc ?
I said default MacOS shell is ZSH now, not Bash
Vlad
Vlad
I just don't get where this assumption comes from
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
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}
Vlad
Vlad
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
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
с
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
klimi
B
Ludovic 'Archivist'
Damo
Hi
Damo
Can anyone send me c++ 11 and c++ 14 notes