Why Does my Application Segmentation Fault When Using the pthread Library? Primary Software: Driver Software>>NI-DAQmxPrimary Software Version: 8.0 Primary Software Fixed Version: N/A Secondary Software: Driver Software>>NI-DMM, Driver Software>>NI-FGEN, Driver Software>>NI-SCOPE
Problem: I'm programming in C or C++ in Linux using the pthread library, and my application is experiencing segmentation faults. Are there any suggestions on how to fix this? Solution: When using the pthread library on Linux it is recommended to link your application with the gcc -pthread flag instead of linking directly with, for instance, -lpthread. If, after replacing -lpthread, you still get a segmentation fault, you must explicitly link the dl library (-ldl) as the first library in your list. Related Links: http://www.ni.com/linux Attachments:
Report Date: 02/16/2006 Last Updated: 02/16/2006 Document ID: 3OLENG00 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
