namespace "Detours" has no member "uint8_t" [closed] - c++

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have been trying to create a dll program for a game called csgo. But my main problem is that it wont work until I have fixed this bug.
<namespace "Detours" has no member "uint8_t">
It happend right here:
oEndScene = (EndScene)Detours::X86::DetourFunction((Detours::uint8_t*)d3d9Device[42], (Detours::uint8_t*)hkEndScene);

Detour namespace doesn't define a uint8_t type (since it is from Microsoft, I think they'll name it something like USHORT). It is available in the STL in the global namespace. So to resolve this, dont specify where (which namespace) the type comes from,
oEndScene = (EndScene)Detours::X86::DetourFunction((uint8_t*)d3d9Device[42], (uint8_t*)hkEndScene);
And make sure to include stdint.h or inttypes.h header file to get the type.
Additional: Use reinterpret_cast<uint8_t*>() instead of (uint8_t*).

Add
#include <cstdint>
then remove the "Detours" part of "Detours::uint8_t". Just use the regular uint8_t, I don't think you need the wrapper.

Related

Declaring non-intrinsic types with () after variable name has different behavior than without. i.e. std::map<int,char>x(); - what's with that? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have a member variable declaration of:
std::map<int,char>x;
in my header file.
It compiles, but when I run my binary I get a segfault in the initialization of the class, before I even get into the constructor.
If I change the declaration to std::map<int,char>x(); -i.e. I just added a () after the variable name - it works fine, no segfault.
I can't give any more specific example than the above, but if anyone has experience with this I'd be interested to know what's going on.
Compiler version is gcc version 4.8.5
target is x86_64-redhat-linux
I realize this is fairly nonspecific but I'm only looking for a general answer.
Thanks.
This is the most vexing parse, as coined by Scott Meyers.
In the standard, look up Ambiguity resolution [stmt.ambig].
As for the segfault, you will need to provide the code (see MRE) to help you with that.

Linker Command failed with exit code 1 Xcode 9 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
So I've gone through a lot of these same questions and none of them seem to work for me. I made a class that I use in my main called TokenClass.cpp. The project will build fine as long as I don't have #include "TokenClass.cpp" in there(The only issue being I can't use that class anymore.) I've tried deleting my DerivedData, and I this is my first project using xcode.
You should not
#include "TokenClass.cpp"
You should include header files only (.h). Seems like you have infinite recursive includes.

Conflicting types for 'memchr' [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm currently trying to modify a library (ASN.1 Compiler), written in C, so I can compile and use it in C++ Builder (XE6).
Doing that, I've encountered the error "Conflicting types for 'memchr'" (in cstring).
After some research, it seems that this problem comes from the fact that C and C++ code are mixed. However, I can't use the solutions suggested by the article in which I read that since they are related to the GCC compiler, when I'm using C++ Builder and its compilers.
What can be the solutions to solve this error?
Thank you
You probably mix including cstring and string.h. Do not do this.
The former declares:
void * memchr(void *, int, size_t);
the latter does
void * memchr(const void *, int, size_t);
Those are not of the same type.

size_t redefined in calcstar [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I need to use calcstar that is math expression evaluator...
I just simply include calcstar.h file and it include everything else
#include "calcstar.h"
but when I try to compile my code i get this error:
size_t redefined
This error appears inside calcstar's own files...but the point is that this library is published online so I assume it is tested and doesn't have a bug...
What is the problem? Am I doing something wrong?
I really need a mathematical expression evaluator for my project.
CalcStar, assuming you got it from here, was apparently developed using Visual Studio 2008 (the download file name is CalcStarApp_VS2008_03202014.zip.).
One of the quirks of Visual Studio is that it allows redefinition of typedefs. Other compilers (like the one you appear to be using) do not.
You'll need to modify code appropriately.

how to get the function access the other .cpps variables? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I tried to create a small application to get used to fileI/O but I don't know how to get the load()-function in Functions.h to overwrite to variables in main.cpp with the ones in Functions.h
I save the variables from the main.cpp by using them as parameters in a function.
All fine so far
But when I call the load()-function in the main.cpp it loads the variables from the file and stores them in Functions.h
i could do
var = Functions.var;
everytime but as this programm is controlled by the user i need a way to do what I wrote above inside of the load()-function.
I hope you understand my problem and may be able to help
im sorry if a similar question was already answered but I didn't find anything helpful when searching but maybe this was just due to me not knowing what to search for
It's a bad design if a load function knows too much about other variables. Instead, you should use a function argument. Pass the variable that you want loaded to the load function. That does mean that you need a reference parameter:
void load(std::string& var) { ... }