Questions tagged [redefinition]

276 questions
0
votes
1 answer

Usage of enum name as value identifier in Objective-C

Referring to this post it seems that there is no possibility in Objective-C to define two enums with the same value as in this example: enum AnEnum { AnyValue }; enum AnotherEnum { AnyValue // Error: Redefinition of enumerator 'AnyValue' }; I…
0
votes
1 answer

Weird header can't be included in both main.cpp and window.cpp (a class)

I have to create a static-linking standalone .exe file from my .cpp and .h files. The only obstacle I need to overcome is being able to call the same function m_pListAll()from two .cpp files, main.cpp and window.cpp (defining a class called…
JoseOrtiz3
  • 1,785
  • 17
  • 28
0
votes
1 answer

C++ include guards and multiple definition errors

I have a situation where I need to include a header file (stack.h) in 2 .cpp files. The set up is as below: //------"stack.h"------// std::stack s; int a; void doStackOps(); void print(); //------"stack.cpp"------// #include…
ggog
  • 13
  • 4
0
votes
1 answer

Why does #ifndef not work in this situation?

Note: The question has already been answered here undirectly The problem is not include guards : they won't help across different translation units Note: I know the solution is to use extern keyword. I'm new to C++. I have a problem…
omerfarukdogan
  • 839
  • 9
  • 26
0
votes
2 answers

Codeblocks int main previously defined here

Trying to make a basic rpg here and in devc++ I was getting all sorts of win file errors about not having a %. stop. So i switched to codeblocks and now even the basics won't compile. The errors are like this: C:\Users\Elliott…
Elliott Pew
  • 3
  • 1
  • 2
0
votes
2 answers

Redefinition in C++, previous definition in header file?

So I am confused. I am getting a redefinition error when trying to implement a method previously declared in a header file. I added include guards to the header and still got the same error. If someone could explain to me what I am not seeing, that…
Max Howard
  • 23
  • 2
  • 5
0
votes
2 answers

What is meant by 'data variable'?

What does 'data variable' mean in MSVS2010 in this error? I thought I was declaring a symbol that is defined elsewhere in my code. error C2365: 'g_surf' : redefinition; previous definition was 'data variable' Obviously this could mean an int or…
Jaden
  • 30
  • 9
0
votes
1 answer

How to add a key into a derived schema?

Here is a simplified example of the problem: base.xsd:
Andrej Adamenko
  • 1,650
  • 15
  • 31
0
votes
1 answer

forward declarations of structures throwing a redefinition error

This code is compiling and functioning properly on a different environment in C using gcc. I am in the process of porting it into a new C++ environment using g++ and getting a redefinition error. I've seen similar issues, but my problem might stem…
Renfro
  • 5
  • 2
0
votes
1 answer

Error C2371 when compiling C dll deployment MATLAB code

I'm trying to compile a C dll using VS2010 with MATLAB 2007b. I get this error: c:\program files\microsoft visual studio 10.0\vc\include\yvals.h(576): error C2371: 'char16_t' : redefinition; different basic types c:\program…
0
votes
1 answer

Codeigniter - Is it possible to redefine anchor function

I have human friendly urls without index.php. I had to modify .htaccess file for that. Actually I always use Codeigniter like this. My url-s always look like this: www.example.com/controller/function/parameter So if I have an extra url parameter,…
user568021
  • 1,426
  • 5
  • 28
  • 55
0
votes
0 answers

Is there a way of detecting all definitions of a symbol when debugging C2371: redefinition; different basic types?

I seem to continually see compile errors in mine and the projects of others where, in particular, size_t is detected as redefined. Sometimes this can be traced back to an x86/x64 mismatch but often it seems to make no sense at all and be the result…
J Collins
  • 2,106
  • 1
  • 23
  • 30
0
votes
3 answers

Error C2082: redefinition of formal parameter 'tmp'

Scenario is I have a function which calls parameterized constructor when I want to initialize. So what I want to do is to call constructor of my choice when I want. But it works when I use A() to call default constructor but it does not work with a…
user3461957
  • 163
  • 2
  • 5
  • 14
0
votes
1 answer

Class redefinition c++

I have a c++ project which has a class called A. I also have a header file, called Definitions.h. I wrote the following code in the header file: A* aClass; And in the main of the application, I write: aClass = new A(); This gives me the…
Idanis
  • 1,918
  • 6
  • 38
  • 69
0
votes
1 answer

class type redefinition and base class undefined errors

I have the following code which returns below errors SFDHelper:'class' type redefinition--File=sfdhelper.h SFDHelper:base class undefined--sfd_metadatamanager.h SFDHelper.h: class SFDHelper { protected: private: public: SFDHelper(); …