- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a large set of subroutines that are part of a scientific simulation that run correctly as intended when compiled as one project. when the same set of subroutines are combined into a static library, and this library is linked with the main program some variables are overwritten which causes the program to not run correctly. What can be a possible reason for this issue?
Thank you in advance
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Most likely is an error in your program that is using out-of-bounds memory to reference something. The different linking changes the memory layout of the code, so what may have been harmless before is no longer harmless. As a first step, rebuild with all run-time checks enabled, and also make sure that generated interface checking is enabled (it is by default in a Windows Debug project.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks Steve for the prompt answer.
I tried this and found that the checks were all enabled already. However, I still get the same issue of overwriting variables with no run time error messages.
Could there be other linking issues?
Thanks again
Motaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve's comments still stand, there are many such errors that the compiler checks do not pick up. Does your code have standards compliance checking BTW? I have personally found that eliminating those not standard things 'that have always worked' has flushed out loads of hidden issues and unexpected behaviours. That can be a big job!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page