Category : unix

I am having some difficulty with finding out how to correct the segmentation fault. client.cpp #include <errno.h> #include <signal.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <netinet/in.h> #include <sys/socket.h> #include <netdb.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <arpa/inet.h> using namespace std; int call_socket(char *hostname, unsigned short portnum) { struct sockaddr_in sa; struct ..

Read more

On macOS 12, I tried to set some environment variables in CMakeLists.txt file like this. # Add environment variables set(ENV{VK_ICD_FILENAMES} /Users/username/VulkanSDK/macOS/share/vulkan/icd.d/MoltenVK_icd.json) set(ENV{VK_LAYER_PATH} /Users/username/VulkanSDK/macOS/share/vulkan/explicit_layer.d) But I quickly realize those environment variables only affects the current CMake instance. Basically, if I use message() in the same CMakeLists.txt file, CMake can print out the exact same value as ..

Read more