Question

I have a large solution made from a combination of c++ and c# projects, most of which output dll's. We also have an executable which depends on the outputs from those projects. Our entire solution is currently built in VS2005. For numerous reasons we have to target v80 for our builds, but we've finally found time to move to the 2010 IDE.

When we build in 2010, our solution all compiles fine, but we get an access violation when running the app. This exception occurs in a number of scenarios, but always at the same point in code - It also shows as an "exception encountered during a user callback". If we edit out the line of code where the exception throws, it simply moves to somewhere else, which makes sense. The scenario's in which we have the issue are as follows:

All dll's and exe built in 2010 against the v80 toolset. All dll's build in 2005, exe built in 2010 against the v80 toolset.

Notably though, if we use the dll's built in 2010 (against v80) but the exe built in 2005, everything works fine.

My question then is: What is the difference between the output from a build in 2005 and the output from a build in 2010 using the v80 toolset?

The above is probably dependent on whether it is possible to exactly match the commandline arguments for the build (ie, c++ and linker configuration) as it may be we haven't quite got those right. If needed I can link the settings from 2005 and those from 2010.

Any help would be much appreciated.

UPDATE: I've recently created a very simple application in 2005, consisting of a dll and exe. The dll has a function static __declspec(dllexport) int add(int a, int b). The exe is a simple console application which calls the add function from the dll.

I then ported this to VS2010 and set it to the v80 toolset. Building this produces a dll with the same size as the original, the exe however is 4KB bigger. I'm using dumpbin to try and find out why, but I don't know it too well at the minute. If anyone else can identify in this simple case why the exe's are different sizes, this may help solve my overall problem

Was it helpful?

Solution

Solved this now, the issue was caused by DEP being turned on by default. I can confirm for anyone else though that the output from the builds should and will match exactly if you use the same compiler and linker settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top