Skip to content
Advertisement

Tag: c++

Rename generated files in Makefile

I have to modify a Makefile such that the intermediate files with extension .cc are moved to .cpp before building the .o. files. My modified Makefile looks like below. protoc is a compiler that generates .cc files. How to make targets so that after generating the .cc files those are move to .cpp and then the client_grpc is built using

C++ get source file directory in Linux

This question is many time asked and I referred all, but I need bit different. I am using macbook -> Clion (IDE) for C++ My program file location /Users/Kandarp/ClionProjects/SimulationParser/main.cpp When I use following function for get current directory it gives different file (I think actual path where file is compiled and execute) it gives following answer: /Users/Kandarp/Library/Caches/CLion2016.2/cmake/generated/SimulationParser-50b8dc0e/50b8dc0e/Debug But I need

What additional purpose can ai_protocol serve in hints while calling getaddrinfo() when ai_socktype is already specified?

The getaddrinfo accepts struct addrinfo *hints as the third argument which can be used to specify the criteria for selecting socket addresses to be returned by this function. The documentation says that we could set ai_socktype as well as ai_protocol to specify our selection criteria. However, I am unable to understand why ai_protocol is required if we already specify ai_socktype.

how to alternate continously Signal handler

I want to write a program in c for linux that catchs the first SIGUSR1 signal, ignores the second one and continue in this behaviour (catch-ignore) for the successive SIGUSR1 signals. I wonder how to keep alternating between the two handlers, because once i set the handler to SIG_IGN, the signal will be ignored and I won’t be able to

Windows 7/10 – Make Application launch on a different display

I am porting a Linux application to windows , there are two executable’s which need to be launched on primary and secondary displays respectively. In Linux its done through #!/bin/sh script,something like display_start_dualhead LVDS 800 480 DVI 1024 768 24 export screen_main=$LVDS export screen_secondary=$DVI how can this be done in Windows , launching exe1 in monitor 1 and exe 2

2 program get same udp packets from a port

there is a server will send some UDP packets to my localhost, for example: if it send some UDP packets to my localhost and destination port is 5000. and there will have a client program to receive it on port 5000. but, what I want is to create another program, it will try to receive the same packets on port

Advertisement