Windows 7 and Cygwin64 segfault

C, C++, and Visual C++
Post Reply
jbattin
Fresh meat
Posts: 2
Joined: Wed Oct 23, 2019 3:48 pm
Contact:

Windows 7 and Cygwin64 segfault

Post 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;
}
jbattin
Fresh meat
Posts: 2
Joined: Wed Oct 23, 2019 3:48 pm
Contact:

Re: Windows 7 and Cygwin64 segfault

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests