Saturday, 15 June 2013

c++ - Linking unreferenced libraries breaks my program -


I have a post processing program that has interfaces with Abacus Program Abacus 6.9 Works fine with EF 1 Abaqus I want to update the program to work with 6.12. I have not had any luck with getting the program to work with the updated API.

I have updated the list of libraries to be linked in Visual Studio 2010. Everything creates and links properly when I run the program, I main :

 error message

Because the program is large (> 120k lines), I decided to return to the default. As long as I do not call delete , the simple program runs fine until once I call delete , I get a single error message If I do not link to Abaqus libraries, then the program runs completely.

  #include & lt; Iostream & gt; Int main (int argc, char * argv []) {std :: cout & lt; & Lt; "Hello World" & lt; & Lt; Std :: endl; Int * p; P = new int (3); Std :: cout & lt; & Lt; * P & LT; & Lt; Std :: endl; Remove p; Return 0; }   

To clarify:

Case 1 : Abaqus runs fine not linked to libraries.

Case 2 : Linking Abacus libraries Debug failure message failed.

Bottom line : I do not know how to link, but not using their libraries have broken a simple program.

In my previous problems with Abaqus, I have convinced myself that they have created their own new and delete operators. Their version of new can be called while the standard version of delete is called? If so, is there a way to solve the scope of these works?

It has been found that Abaqus defines global namespace in its own Delete the operator new and operator . Thus, I was unknowingly linking the implementation of the new operator of my .

However, in the Abaqus definition of Visual Studio operator is associated with Abacus definition and not to delete operator . Instead, Visual Studio is connecting with the standard definition of operator delete .

These functions can not be used embedded, so I get an error message. However, because Abacus has put its operator new and operator delete functions in the global namespace, I believe I have no control over which function Link.


Update: The above is only partially correct. Abaqus defines its own operator new , but at least they delete the operator in the global namespace defined no

In this way, Visual Studio can not link related abacus operator delete as it does not exist.

No comments:

Post a Comment