Page 1 of 1

Windows 7 and Cygwin64 segfault

Posted: Wed Oct 23, 2019 3:59 pm
by jbattin
Application works ok on SBC3 but I am trying to port to Windows 7 with Cygwin64. When compiling with g++ and Cygwin the Minimal application compiles and links OK but segfaults on PhidgetVoltageInput_create. GDB reports no stack. Verified the windows Phidget Application works OK. What could I be missing? Compiled the following example with:

Code: Select all

g++ -std=c++11 -g -Wall -I"/cygdrive/c/Program Files/Phidgets/Phidget22" phidget_test.cpp -o phidgety -L"/cygdrive/c/Program Files/Phidgets/Phidget22" -lphidget22

Code: Select all

#include <phidget22.h>

int main() {
	PhidgetVoltageInputHandle handle;
	PhidgetVoltageInput_create(&handle); //segfault
	return 0;
}

Re: Windows 7 and Cygwin64 segfault

Posted: Thu Oct 24, 2019 8:32 am
by jbattin
Turns out it has something to do with 64bit builds. I installed the Cygwin64 32 bit toolchain (cygwin32-gcc) and runtime (cygwin32-w32api-runtime) and was able to run the application without a segfault. I am assuming the failure has something to do with the LLP64 data mode described in the section titled "Building Applications for 64bit Cygwin" in the cygwin documentation.