LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging Static libraries

Sorry if this is obvious to some but...

When I configure a LabWindows/CVI project target to be a dynamic library, I can configure for release configuration or debugging configuration. WHen I configure the project as a static library, it forces me to release configuration only. Why?

Inquiring minds want to know (and want to debug a static library),

Chuck
0 Kudos
Message 1 of 3
(3,258 Views)
A static library cannot be debugged in the same sense a dynamic linklibrary (DLL) can. A DLL is a seperate memory module with its own memory space and stack, pretty much like an executable that needs another process to run it. A static library is code that actaully gets combined into your application when its compiled, its not loaded seperately at runtime.

The best way to debug a static library is to use asserts or DebugPrintf statements to indicate to the debugger if anything bad has happen or just to allow you to follow the execution path.
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,242 Views)
For debugging, you could create two projects, one target type Executable, the other Static Library.
In the Executable project, include all the .c files for the Static Library plus a new file which will contain main() to call your library functions. You can include both projects in the same workspace and go back and forth in the project window by selecting File >> Set Active Project. Do your debugging in the Executable project, then build the Static Library.

Why do you want to create a Static Library instead of a DLL?
0 Kudos
Message 3 of 3
(3,233 Views)