Questions tagged [redefinition]

The tag has no usage guidance.

redefinition
Filter by
Sorted by
Tagged with
1 vote
2 answers
62 views

Getting an error : redefinition of struct within a .h program

#include <stdio.h> #include <stdlib.h> typedef struct sommet sommet; typedef struct voisin voisin; typedef struct graphe graphe; struct sommet{ int indice; sommet* next; ...
Etienne Vézien's user avatar
-1 votes
1 answer
84 views

Why do I get weird class method redefinition errors when I compile with Visual C++ 2022?

I'm trying to write my vector, to realize the function of the one in STL as much as possible. However when I tried to run a test project, Visual Studio told me that, const version of begin(), const ...
CubeLitBlade's user avatar
0 votes
0 answers
29 views

Oracle 19c. REF Partitioning. Start redefinition Holds TM lock on parent table in 4 mode (when insert data into interim table)

I have this TM lock on interim's parent table for the whole duration of loading the interim table of redefinition (DBMS_REDEFINITION.START_REDEF_TABLE) that has a FK to a table used by other session ...
Atta's user avatar
  • 1
0 votes
3 answers
97 views

C: redefinition of function when using #include

I have encountered an issue in C that I am unable to recover, being "redefinition of [function]", and when I checked for a redefinition, I don't see any. this always occur when the files are ...
Ponali's user avatar
  • 1
0 votes
0 answers
45 views

how to solve the redefinition error in c++ [duplicate]

For some reason when i run a c++ program with special characters they are not displayed as they should, so i made this header file: #ifndef Tildes_h #define Tildes_h unsigned char a_con_tilde = 160; ...
user avatar
-1 votes
1 answer
82 views

Is redefinition of a pointer prohibited in c++ despite the pointer not being const?

In the tutorial that I am following, it is mentioned that pointers can be redefined to contain the addresses of a different variable, as long as the pointer is not constant. But the following block of ...
Abhijit Saha's user avatar
0 votes
0 answers
15 views

microchip samc20n18.h SAMC20_DFP/1.1.151/samc20n/include/samc20n18a.h:212:34: error: redefinition of 'INT10_Handler'

Compile Error message : C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMC20_DFP/1.1.151/samc20n/include/samc20n18a.h:212:34: error: redefinition of 'INT10_Handler' samc20n18a.h has void ...
kys's user avatar
  • 1
1 vote
1 answer
82 views

C++ function template specialization, function redefinition error

So, I have an assignment for college to create templates for these functions and ive done it by the instructions.. However, the fillDefault, which I had to make a specialization for int doesnt work. I ...
PrzgiBaklo's user avatar
2 votes
2 answers
76 views

Common symbol reported as 'redefined' in ancient NASM versions (0.98.39)

I'm trying to compile this source (already stripped down to minimum) with NASM 0.98.39: common foo 2:near mov word [bx], foo dummy: Unexpectedly, I get the error message: $ nasm-0.98.39 -O9 -f obj -...
pts's user avatar
  • 84.9k
-2 votes
1 answer
514 views

Why is the redefinition of functions in c++ failed in vscode? [closed]

I want to use the virtual function in my program. However, VSCode keeps telling me errors in the redefinition of the function. This is my error message: exp8_2.cpp:29:7: error: redefinition of 'float ...
Tim heard you's user avatar
-1 votes
2 answers
79 views

Error C2011, Tried everything already asked on here [duplicate]

i am new to Cpp and am having this error: Error C2011 'point2d': 'struct' type redefinition it is the first time i use modules, and i am having an error with the headers. Here is my code: ...
Karl Antoun's user avatar
1 vote
1 answer
3k views

How do I avoid the "multiple definition of ..." Error in this case

Boardcomputer.h: #ifndef BOARDCOMPUTER_H #define BOARDCOMPUTER_H #include <Arduino.h> #include <TFT_eSPI.h> TFT_eSPI disp = TFT_eSPI(); ... #endif Boardcomputer.cpp: #include <...
Levi's user avatar
  • 31
1 vote
2 answers
91 views

Redefine Python object method?

Suppose I have a class Foobar and I want to redefine a method of one of its instances: class Foobar: def myMethod(self): print('this method was not overridden') foo = Foobar() def foo....
Tuor's user avatar
  • 1,005
0 votes
1 answer
83 views

Difference between redefinition of array elements in C

I am a beginner in C and During Programming I have found this code about bitwise addition #define WORD_FROM_BUF(WRD) ((((unsigned char *)(WRD))[0]<<8)|((unsigned char *)(WRD))[1]) I have tried ...
Ayman hussien's user avatar
0 votes
2 answers
35 views

Python3 redefine a class: super still calls old class

This code: class a: def __init__(self): print("a here") class b(a): def __init__(self): print("b here") super().__init__() B = b() class a: ...
tedtoal's user avatar
  • 1,050
3 votes
1 answer
77 views

Why this code is NOT causing redefinition error?

#include <initializer_list> struct Foo { template <typename T> Foo(std::initializer_list<T>) {} template <typename T> Foo(std::initializer_list<typename T::...
mikerru's user avatar
  • 33
0 votes
1 answer
186 views

Define sqlalchmey tables based on function input

This is a follow up question to this question. I'm trying to implement a function that generates a table. The function looks like this: import sqlalchemy as sql import sqlalchemy.orm TableBase = sql....
Gian Laager's user avatar
5 votes
1 answer
280 views

Why is this compiling successfully?

What is the reason which why this code compile : #include <iostream> using namespace std; class being { public: void running(char c) { cout << "No one know "; } }; ...
Fady Hany's user avatar
0 votes
1 answer
120 views

I want to collect the table elements and create a new table. (lua)

I can't find a similar case. Please Help! (lua) input : table1={'a','b','c','d','e'} table2={'aa','bb','cc','dd','ee'} table3={'aaa','bbb','ccc','ddc','eee'} ... output : group1={'a','aa','aaa',...} ...
이신발's user avatar
0 votes
1 answer
45 views

Can a class definition from one .lib supplant or extend a definition from another .lib?

I have a Commons.lib project I stick a lot of my reused code in, that has gotten too big for it's own good (breaking a parser in it would halt work in 20 unrelated projects, stuff like that). I'm ...
Anne Quinn's user avatar
  • 12.8k
5 votes
3 answers
1k views

Which Python object comparison methods to redefine to make sorted() work?

I feel this question must have been asked before but I could not find an answer. Suppose I want to implement a Python class whose objects are sortable with sorted(). Do I have to reimplement all ...
DYZ's user avatar
  • 56.3k
2 votes
1 answer
184 views

Redefining a fuction used to define this function in Scheme

I think the title is a bit weird but, for example, is there a way to redefine the addition in Scheme so that (+ arg1 arg2) gives arg1 + arg2 + 1? I can create a new function @: (define @ (lambda args (...
Syrocco's user avatar
  • 179
4 votes
2 answers
1k views

How is typedef redefinition meant to work in C11?

I read that in C11 typedef redefinition is allowed, as long as the definitions are the same. However the following code typedef struct { int x; } a_t; typedef struct { int x; } a_t; int main(...
lipi's user avatar
  • 53
0 votes
0 answers
89 views

Does calling functions that are just redefined require polymorphism?

How would C++ tell which definition of a redefined function (excluding virtual functions) to execute if it doesn't do some sort of binding? If it does binding for functions that are just redefined, is ...
CAPITAN CHURO's user avatar
0 votes
3 answers
142 views

How Can I Redefine a Classs Outside of A Loop?

I am getting redefinition of class error for the below code. But if I put this definition in a loop there is no error. What is the difference? using namespace std; #include <iostream> using ...
KC_'s user avatar
  • 89
2 votes
0 answers
68 views

How to define a new function/struct/class if and only if it does not cause a redefinition error?

I am generating c++ code and I need to define a new function/struct/class if and only if it does not cause a redefinition error. How can I achieve this? I think the solution would be to try and ...
SomeProgrammer's user avatar
-1 votes
1 answer
321 views

One-Definition Rule Followed, but C++ throws Redefinition Error

Very strange redefinition error in C++, especially as every other file including main is error-free. I have my headers (various animals) and an implementation file "animals.cpp". My headers ...
faangorn's user avatar
1 vote
1 answer
200 views

Type redefinition of identical definition

If I wanted to use a type, let's say ulong (part of POSIX), but did not know whether it was defined already, is it guaranteed that redefinition with the same definition is benign? This works in GCC, ...
Angel E.'s user avatar
2 votes
3 answers
168 views

Why is it possible to define a variable inside a loop in C?

Why doesn't this code give a redefinition error: int main(void) { for (int i = 0; i < 2; i++) { int number = 5; } } while this code does: int main(void) { int number = 5; ...
kooru_hi's user avatar
0 votes
0 answers
207 views

Redefinition error in different unnamed spaces

I have a redefinition problem with two functions in two different unnamed namespaces, which each is placed in two separate files. The first function grouping is in a one file: namespace { bool ...
swittuth's user avatar
0 votes
1 answer
129 views

HLSL - Why Can't I Redefine this Array?

float myArray[5] = { 0, 0, 0, 0, 0 }; myArray = { 1, 2, 3, 4, 5 }; Why is this not possible to do in HLSL? Is it some kind of memory issue?
Dean Chan's user avatar
0 votes
1 answer
1k views

Why do I keep getting Redefinition of Class Error? C++

I keep getting the error: "Redefinition of 'CBSTree'" and "Previous definition is here" on all my functions in my cbstree.cpp code. I'm not sure why. I believe I have the correct ...
Rachel's user avatar
  • 9
0 votes
2 answers
141 views

How to redefine instance methods in Python?

I am making infrastructure for methods dbg (stands for debug_message), info (stands from info_message) as well as log (logging functionality). The dbg, info, and log methods will be called whatever ...
brikas's user avatar
  • 314
1 vote
1 answer
1k views

How to get back the redefined DPC method which redefinition was deleted?

I have a DPC class in sap for a gateway service. I redefined a getEntitySet method and wrote some code in it. Then I accidentally undid the redefinition and all my code is gone. Is there any way to ...
IsThisNacho's user avatar
3 votes
3 answers
826 views

function redefinition: const parameter

1. In global scope, this gives error: redefinition of 'f' #include <iostream> using namespace std; void f(int x) { cout << "f" << endl; } void f(const int x) { cout &...
kgf3JfUtW's user avatar
  • 14.4k
0 votes
1 answer
1k views

Is there a way to ignore redefinition with clang?

I am getting a Clang compiler error when compiling ROOT script: ~/root_install/include/ROOT/RStringView.hxx:32:4: error: redefinition of 'basic_string_view' as different kind of symbol using ...
Martin Vít Vavřík's user avatar
2 votes
1 answer
7k views

How to resolve a C++ Error: Redefinition of 'class'

I am new to C++ programming and have a compiler error that I can't figure out. Any help would be appreciated. Here is the build log: C:\Dev\MemberTest\Entity.cpp|6|error: redefinition of 'class Entity:...
Jassaway's user avatar
0 votes
1 answer
309 views

How to properly use __if_not_exists and __if_exists

Currently, I am trying to deal with a problem where I want to prevent variable redefinition. I have currently achieved the avoidance of the redefinition by means of a token paste which can "paste&...
dejoma's user avatar
  • 394
1 vote
4 answers
728 views

Java : this alone in method

Hello everybody i'm currently learning java programming and I don't understand a part of code. I searched a long time but I didn't found anything. Here is my code: public boolean equals(Object obj) ...
Sutekina's user avatar
0 votes
2 answers
160 views

How can you use compound assignment operators in C if you can't redefine variables?

Looking at wikipedia it says: a -= b; is the same as a = a - b; But when I try this in my C program I get the following error: "error: redefinition of 'a'". Here is my program: #include &...
CClarke's user avatar
  • 540
0 votes
3 answers
68 views

Avoiding Template operator overload collisions for float and non float on the operator first argument

I have a situation where my template modulus operator does play nice between floats and integer-ish types. As I recall there is a way to make it select the more specific one over the broader scope one,...
Ismael Harun's user avatar
-1 votes
2 answers
392 views

C++: redefinition of a 'classname'

I'm writing a code describing a complex variable and a real variable. i've included the header file which seems to produce a conflict between the .hpp file and the .cpp file. They are similiar and I ...
user6394019's user avatar
0 votes
0 answers
85 views

C++ How to Fix redefiniton without changin the function or linked CPP files?

I am fairly new to C++ and trying to get used to it after learning Java. For an assignment, I was given two different CPP files both containing many different functions but are not classes. I have to ...
bicibocu's user avatar
0 votes
1 answer
409 views

C - redefinition because of head inclusion

I program in C with ANCI C and I have a problem with bool definition. I've created a header bool.h that only contains '''typedef enum { false, true } bool;'''. The problem is that I have 2 header ...
Stevie's user avatar
  • 421
1 vote
1 answer
185 views

Using two different math libraries in the same project confuses Visual C++

My project needs to use both Micorsoft Visual C++ math.h and Intel MKL math.h. Building with verbose details, I get: 1> Note: including file: C:\Program Files (x86)\Microsoft Visual ...
Pietro's user avatar
  • 12.6k
0 votes
1 answer
168 views

How do I redefine a non-nbsp to be a nbsp

There are to the best of my knowledge only two non-breaking spaces: U+a0 (no-break space) and U+202f (narrow no-break space). However, there are other spaces in use, each with their own usage. For ...
Canned Man's user avatar
0 votes
1 answer
672 views

#undef seems to have no effect on macro redefinitions (warning C4005)

Trying to fix the following "macro redefinition" warning: 1>Path\to\MKL\include\math.h(1577): warning C4005: 'HUGE_VALF' : macro redefinition 1> Path\to\Microsoft Visual Studio 12.0\VC\...
Pietro's user avatar
  • 12.6k
2 votes
2 answers
5k views

Incompatible redefinition of macro

When I compile my c project with make command, there is the error Error: #47-D: incompatible redefinition of macro "MACRO_NAME" It looks like MACRO_NAME is already defined in one of the header ...
corning's user avatar
  • 371
1 vote
2 answers
817 views

I'm having an 2D Array Redefinition Error

There is an error (actually 3 same errors) with my definition array int mang[max][max] and I couldn't find anything to fix it properly, so I hope someone will notice my question and help me soon. XD ...
Minh Nhat's user avatar
0 votes
1 answer
411 views

Trying to use an object in another class's header file, getting "redefinition of class" error

I am currently trying to define a class "School" in a School.hpp file. Part of the School class is a vector of Student objects called roster. If I #include "Student.hpp" in School.hpp, the compiler ...
Eric Pitts's user avatar

1
2 3 4 5 6