Qt Executable error : 0xc0000139 trying to merge c

2019-07-29 20:00发布

问题:

I have a simple application in qt and I'm trying to link some code that I have to it. However, when I'm merging the files in the project, it compiles, but I get an error at startup. When I try to debug it, I get a pop up message telling me Executable error : During startup program exited with code 0xc0000139.

I searched in google and I found that it's probably a dll error. I've got to admit, I don't really know how libraries work so I'm a bit confused.

I trying to import the code functions by functions to see what's working and what is producing the error. A simple function like this :

void descendanceOf(std::vector< std::list<int> >& tree, int node){
        std::list<int> descendance;
        descendance.push_back(4);
}

produces an error, but I function like this :

bool isFatherOf(const std::vector < std::list < int > >& tree, int node1, int node2){ 
    for(std::list<int>::const_iterator it = tree[node1].begin();
            it != tree[node1].end(); it++){
        if((*it) == node2){
            return true;
        }
    }
    return false;
}

works perfectly fine. I'm confused. At first I though it has something to do with the std library, but both functions use it.

回答1:

You should download a copy of dependency walker to figure out if the application can find most* of its required DLLs (that aren't loaded via dlopen). http://msdn.microsoft.com/en-us/library/ms235265.aspx

For windows the paths to all/most DLLs are typically in the environment variable %PATH%.

You can launch a cmd prompt and type "set" to view all environment variables.