Why is this code resulting in bad access? [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 4 years ago.
Improve this question
WildcardFileFilter wavFiles = WildcardFileFilter("*.wav", "", "wavFiles");
fileChooser = new FileBrowserComponent(
FileBrowserComponent::FileChooserFlags::openMode
| FileBrowserComponent::FileChooserFlags::canSelectFiles
| FileBrowserComponent::FileChooserFlags::canSelectDirectories,
File("/Users/harrygardiner/Desktop"), &wavFiles, nullptr);
I'm trying to isolate .wav files in my audio application but it keeps telling me I have bad access problems, why is this?

Your wavFiles lives on the Stack. fileChooser is probably outliving wavFiles and then tries to access it resulting in undefined behaviour.

Related

How to get more than 50 transitions in boost msm? [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
I am using boost msm to implement HSM and I am at the point where the maximum number of transitions possible is 50. I looked at some blog posts and they said that if we create /mpl/vector/vector60.hpp, it should work. I tried and this is the error I get
I am wondering how I am generate these vector60, vector70.hpp .. files or map60, map70.hpp files so that I can get more transitions.

Expected unqualified - ID _config [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 6 years ago.
Improve this question
So I'm brand new to c++ and just started the beginner class. The professor has given us the exact prompt to put into the program and I am still receiving an error. I have checked over and over for any small flaws such as spacing or random ";" that a lot of people seem to do, but still no results. Can anyone see anything wrong with what I have down?
Remove asterisk (*) right below "//Purpose of this program ..." and try it again.

Marshelling exception in CORBA [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
When i tried to register my POA in corba, i am getting Marshelling exception. I registered all registry already with my object.
I m using ACE/TAO 2.0a
Any help appriciated
Architecture has been changed in corba since 1.3a now you have to try registering all MarshellingProxyies that supply. Please have a look at new registryfactory in CORBA 2.2a,

C++, Progam Detection [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 want to detect if a window/process is running, and if it does, to make the c++ program close.
Something like this:
if (FindWindow(NULL, TEXT("Fiddler"))) {
;
std::exit
;
}
It doesn't works for some reason.
WHy do you have random semi-colons floating in space?
This code should look like:
if (FindWindow(NULL, TEXT("Fiddler")) != NULL)
{
std::exit(0);
}

What is causing popen to segfault? [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 4 years ago.
Improve this question
I have tried searching for this online, but I haven't had any luck. I'm hoping there are some theories here. We were able to get our code to crash on this line:
pipe = popen(cmd, "w");
cmd has recently been allocated, but the allocation was checked to verify that it wasn't null and inspecting the core file reveals that it is indeed a valid string. I'm curious what else would cause popen to segfault if the parameters passed in are valid ? Will popen segfault if there are no more available file descriptors on the system? Are there any other things I can look into for why this might've failed?
Thanks.