redefinition

error C2375: redefinition; different linkage

喜夏-厌秋 提交于 2020-02-23 11:00:09
问题 Error place in api: #define DLLEXPORT extern "C" __declspec(dllexport) DLLEXPORT int CAnyseeUSBTVControllerDlg::InitCaptureDevice() { In my .h library class and function definition: class CAnyseeUSBTVControllerDlg : public CDialog { // Construction public: int InitCaptureDevice(void); Any idea how to resolve it? "Error 1 error C2375: 'CAnyseeUSBTVControllerDlg::InitCaptureDevice' : redefinition; different linkage c:\Program Files\toATS_DVS\anysee\anyseee30\anyseee30\anyseeUSBTVControllerDlg

Ansible group vars priority

自古美人都是妖i 提交于 2020-01-23 05:10:41
问题 Let's say I have 3 files in group_vars: abc.yml all.yml xyz.yml And the same variable defined in them: - my_var: abc - my_var: all - my_var: xyz Ansible documentation says: Within any section, redefining a var will overwrite the previous instance. If multiple groups have the same variable, the last one loaded wins. If you define a variable twice in a play’s vars: section, the 2nd one wins. Does it mean that load order is alphabetical one and abc.yml has the lowest priority, whereas xyz.yml

Redefinition different basic types => typedef

与世无争的帅哥 提交于 2020-01-17 15:40:15
问题 After to have been aware of the persons who had the same problem than mine, I still get this error : error C2371: 'ST_ELLIPSE' : redefinition; different basic types see declaration of 'ST_ELLIPSE' C2371: 'ST_VECTEURS' : redefinition; different basic types see declaration of 'ST_VECTEURS' 'ST_ROI' : redefinition; different basic types see declaration of 'ST_ROI' 'ST_CONVERSION' : redefinition; different basic types see declaration of 'ST_CONVERSION' 'ST_PARA_VISU' : redefinition; different

Redefine a C function in C++

被刻印的时光 ゝ 提交于 2020-01-16 14:03:06
问题 I have a C library with a function #ifdef __cplusplus extern "C" { #endif void exitWithError(const char* func) { printf("woopsie in %s", func); exit(1); } #ifdef __cplusplus } #endif exitWithError is exclusively called by other C code internal to the library. The C library is always compiled in "C mode", i.e. via g++ -x c ... , conforming to C99, so cannot feature any C++ code. (I've realised now this makes the #ifdef __cplusplus check completely superfluous, but ho-hum, not relevant here). I

Can't include <gl/gl.h>

馋奶兔 提交于 2020-01-01 07:46:11
问题 I'm using Visual Studio 2010. I'm trying to write simple Camera class in OpenGL. I need to include gl/gl.h in Camera.h gl/gl.h is already included in main.cpp and Camera.h is included in main.cpp When I put #include <gl/gl.h> in Camera.h i got bunch of errors like this one: Error 11 error C2086: 'int APIENTRY' : redefinition C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\gl\GL.h 1153 1 Gaz 3D files: Camera.h #include <math.h> #include <gl/gl.h> #ifndef _CAMERA_H #define _CAMERA_H

How to Bypass a Standard C++ Function While Maintaining Its Functionality

假如想象 提交于 2019-12-20 04:10:20
问题 I am looking for a way to be able to redefine a set of POSIX functions but then end the redefinition with a call to the original function. The idea is that I am trying to create a layer that can restrict what OS API's can be called depending on which "profile" is active. This "profile" determines what set of functions are allowed and any not specified should not be used. For example, if in one profile I am not allowed to use strcpy, I would like to be able to either cause a compile time error

C++ class redefinition error - Help me understand headers and linking

眉间皱痕 提交于 2019-12-20 03:17:57
问题 I started writing a simple interpreter in C++ with a class structure that I will describe below, but I quit and rewrote the thing in Java because headers were giving me a hard time. Here's the basic structure that is apparently not allowed in C++: main.cpp contains the main function and includes a header for a class we can call printer.h (whose single void method is implemented in printer.cpp ). Now imagine two other classes which are identical. Both want to call Printer::write_something(); ,

PHP traits - change value of static property in inherited class

爱⌒轻易说出口 提交于 2019-12-12 08:37:07
问题 So, this is my trait: trait Cacheable { protected static $isCacheEnabled = false; protected static $cacheExpirationTime = null; public static function isCacheEnabled() { return static::$isCacheEnabled && Cache::isEnabled(); } public static function getCacheExpirationTime() { return static::$cacheExpirationTime; } } This is the base class: abstract class BaseClass extends SomeOtherBaseClass { use Cacheable; ... } These are my 2 final classes: class Class1 extends BaseClass { ... } class Class2

Why am I getting this redefinition of class error?

て烟熏妆下的殇ゞ 提交于 2019-12-12 07:45:53
问题 Apologies for the code dump: gameObject.cpp: #include "gameObject.h" class gameObject { private: int x; int y; public: gameObject() { x = 0; y = 0; } gameObject(int inx, int iny) { x = inx; y = iny; } ~gameObject() { // } int add() { return x+y; } }; gameObject.h: class gameObject { private: int x; int y; public: gameObject(); gameObject(int inx, int iny); ~gameObject(); int add(); }; Errors: ||=== terrac, Debug ===| C:\terrac\gameObject.cpp|4|error: redefinition of `class gameObject'| C:

How to redefine a function in php?

∥☆過路亽.° 提交于 2019-12-11 09:20:09
问题 Now i'm stuck with file_exists() function. My project is built from repositories, one is symlinked as a DocRoot, others are available to php interpreter via include_path. But the default file_exists() cannot look at the files are placed somewhere under include_path, so i need or somehow redefine this func with a wrapper or to write my own, include it in other modules and replace all matches of this func in the directory tree. It's possible, but is not good and is not clear for developers. I