I’m trying to debug a linux c++ application on a remote offsite server and I got this message: Any ideas? I’ve tried debugging it on an onsite linux machine (through MSVS2015 on windows) and it works fine. Answer I had a snapshot of the server prior to installing gdbserver. It worked after I installed all the components again by doing
Tag: c++
Linux kernel – Context switch when calling function from other module?
I am curious if calling a function from a different module in the Linux kernel triggers a context switch? Basically, I’m doing something like this. Say I have module A: module B: between the two measurements, I’m seeing a gap of up to 2 microseconds (after dividing through the TSC frequency). Could this gap be due to a context switch?
VS2017 Linux C++ threads issue
I have been testing the VS2017 Linux C++ with remote debugger on Linux Ubuntu. I have created a few example projects for C++ and everything has been working great until I got to threading examples. I cannot seem to get the threads to compile as I keep getting “undefined reference to `pthread_create'” error. I know the solution to this is
make using autotools gives undefined reference errors while custom Makefile works fine
I’m trying to convert the build mechanism of ccextractor (Open source closed caption extractor) from custom Makefile to Autotools generated Makefile. Current Makefile looks like this: Building through above Makefile works fine. My Makefile.am looks like this: If I run make after autoreconf -i on above file, build fails with error: If I run ./configure as ./configure LIBS=”-lm -lz” build
Because one line of unrelated code, the speed difference so much
Why use the precompiler to add a line of code, the speed change is so great? ubuntu@host:~/test_intersection$ g++ -std=c++11 -O3 -DLINUX main1.cpp -o main1 ubuntu@host:~/test_intersection$ ./main1 duration: 62080 microseconds,set a size: 2998917 set b size: 3000000 set result size: 2087 ubuntu@host:~/test_intersection$ g++ -std=c++11 -O3 -DLINUX -DTEST main1.cpp -o main1 ubuntu@host:~/test_intersection$ ./main1 duration: 362546 microseconds,set a size: 2998985 set b size:
Using gnu make with a makefile, why is my .o file not deleted?
I have a simple makefile that works correctly with gnu make, except the object file named ‘txt.o’ is not removed, using ‘rm tst.o’. Here is the text from the makefile. Anyone know why the rm command here is not removing the ‘tst.o’ file? Thanks, Matt Answer What command did you enter for the make? If you just enter make, it
linux c++ libev official example show redundant console behavior
I just tried the official example of libev, like below. After compiling and running, I see once I input anything from stdin, the event is triggered, no problem. But what I inputed is still treated as solid input and then appear on my console. My question is: is there a way to avoid this console input from being prompted to
Using linux epoll: epoll_ctl seems to have redundant parameter?
Usually on linux when we wish to use epoll, we first create a epfd, and then register fd and events to it. Above is a common example I found from internet. It works, but problem is: ev.data.fd=fd here I already have my “fd” assigned to ev structure. epoll_ctl still requires the 3rd parameter of this fd. While the 4th parameter
cpp multipleThread: detach non-class type error
I’m writing a program with mutiplethread using cpp , but I have a compiler-error like this: my code could be presented as follow: So anybody have a clue about where I did wrong and what can I do? Answer You’ve hit C++’s Most Vexing Parse. The above declaration doesn’t declare a turnCam as a std::thread object. Rather threadCam is declared
GDB doesn’t recognize some C functions
So I’m new to Linux and just got Ubuntu 16.04.2 running on a VM. I’ve installed gcc/g++ on here in the terminal, but when I run my program in GDB, as soon as I get to a strcmp function, this pops up for many lines. And when I go further down: So I’m guessing it just doesn’t recognize my C