c++

Eclipse IDE make: *** No rule to make target… needed by 'core/abi.cpp.o'. Stop

别说谁变了你拦得住时间么 提交于 2021-02-20 04:07:42
问题 I'm trying to make Arduino projects with eclipse IDE and I have followed this video tutorial and I am getting this error: Building ArduinoTest make: *** No rule to make target 'Ulloa/.arduinocdt/packages/arduino/hardware/avr/1.6.19/cores/arduino/abi.cpp', needed by 'core/abi.cpp.o'. Stop. I'm new with this and I don't know what I could be doing wrong. This is my makefile, it's the one that was generated by Eclipse: ifeq ($(OS),Windows_NT) SHELL = $(ComSpec) RMDIR = rmdir /s /q RM = del /q

How can i ping remote computer on my Windows computer with c++?

我怕爱的太早我们不能终老 提交于 2021-02-20 03:55:11
问题 I used below code. It works, but in debug mode in Visual Studio if you stop the debug the computer gave blue screen so it is not useful. I did some research and i found this is a common bug for icmpapi. Is there a any way to ping computer c++? #include <winsock2.h> #include <iphlpapi.h> #include <icmpapi.h> //Declare and initialize variables HANDLE hIcmpFile; unsigned long ipaddr = INADDR_NONE; DWORD dwRetVal = 0; DWORD dwError = 0; char SendData[] = "Data Buffer"; LPVOID ReplyBuffer = NULL;

What are the drawbacks of C++ covariance return types?

▼魔方 西西 提交于 2021-02-20 03:49:56
问题 I have recently had to deal with C++ covariance return types such as the following construct : struct Base { virtual ~Base(); }; struct Derived : public Base {}; struct AbstractFactory { virtual Base *create() = 0; virtual ~AbstractFactory(); }; struct ConcreteFactory : public AbstractFactory { virtual Derived *create() { return new Derived; } }; It allows the client code to treat the Derived object as a Base type or as a Derived type when needed and especially without the use of dynamic_cast

What are the drawbacks of C++ covariance return types?

最后都变了- 提交于 2021-02-20 03:49:43
问题 I have recently had to deal with C++ covariance return types such as the following construct : struct Base { virtual ~Base(); }; struct Derived : public Base {}; struct AbstractFactory { virtual Base *create() = 0; virtual ~AbstractFactory(); }; struct ConcreteFactory : public AbstractFactory { virtual Derived *create() { return new Derived; } }; It allows the client code to treat the Derived object as a Base type or as a Derived type when needed and especially without the use of dynamic_cast

Vowels in string C++

天涯浪子 提交于 2021-02-20 03:48:55
问题 I should type in string and my program should reorganize elements so Serbian vowels (a,o,i,e,u) should be first elements and then consonants .My idea was to copy vowels in second string and consonants in third and then make one string (using strcat and vowels and consonant string) but that didn't work as planned... Any ideas what to change or how to do it ? #include <stdio.h> #include <string.h> int main() { char s[50],s2[50]; char vowels[50]; char consonant[50]; int k=0,f=0; printf("Type

C++ XCODE ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

你说的曾经没有我的故事 提交于 2021-02-20 03:41:22
问题 I'm getting the following errors when I try to build my c++ program in Xcode: Undefined symbols for architecture x86_64: "DoublyLinkedList::insertFront(int*)", referenced from: _main in main.o "DoublyLinkedList::print()", referenced from: _main in main.o "DoublyLinkedList::DoublyLinkedList()", referenced from: _main in main.o "DoublyLinkedList::~DoublyLinkedList()", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit

How to use weak function in C++

青春壹個敷衍的年華 提交于 2021-02-20 03:36:28
问题 I am trying to use weak function in a class in C++. Below is what I wrote: #include <stdio.h> #include <iostream> class A { public: void func(int argc, char *argv[]) __attribute__((weak)); }; // optional definition: #if 0 void A::func(int argc, char *argv[]) { printf("In func()\n"); for(int aa = 0; aa < argc; aa++){ printf("arg %d = %s \n", aa, argv[aa]); } } #endif int main(int argc, char *argv[]) { A a1; if (a1.func){ a1.func(argc, argv); } else { printf("func() not available\n"); } return

What happens to registers when you manipulate them using asm code in C++?

我是研究僧i 提交于 2021-02-20 03:00:07
问题 Some code: int x = 1; for(int i = 1; i < 10; i++) { x *= i; __asm { mov eax, x }; } If this program uses eax in order to increase the value of i , what will happen when I manipulate eax ? Will the compiler save registers from before the __asm call and use them after the asm code was executed or will it ignore that eax was manipulated and continue producing some sort of strange behavior? What happens to eax internally? EDIT: Even if my code only works with Visual C++ I want to know what

What happens to registers when you manipulate them using asm code in C++?

北城余情 提交于 2021-02-20 03:00:07
问题 Some code: int x = 1; for(int i = 1; i < 10; i++) { x *= i; __asm { mov eax, x }; } If this program uses eax in order to increase the value of i , what will happen when I manipulate eax ? Will the compiler save registers from before the __asm call and use them after the asm code was executed or will it ignore that eax was manipulated and continue producing some sort of strange behavior? What happens to eax internally? EDIT: Even if my code only works with Visual C++ I want to know what

openCV imread limit for large or huge images Mat bug #3258

倖福魔咒の 提交于 2021-02-20 02:52:42
问题 I've been searching for days about this issue and didn't find any solved thread. I need loading pretty large images (4 GB and beyond, either .tiff / .png) into openCV code, by means of a simple src = imread(filepath, 1); I'm using Visual Studio 2013, C++. Though I'm using a 96Gb-RAM machine, runtime alerts are coming out when loading these large images by OpenCV's "imread" function. Been trying with smaller and smaller images/files untill the point they are indeed read/loaded, so we know it's