Skip to content

Segmentation Error #54

@christophergeek

Description

@christophergeek

I know this is only officially supported on Mac and Windows. But I'm trying to get it to work on Ubuntu 18.04 and I'm running into this issue.

These are the steps I took after downloading the source code:

cd sdl
sudo make

I then got the following error:

g++ -I../src -I. -std=c++11 -O3 -I/usr/local/include/libusb-1.0 -I/usr/include/SDL2 -D_REENTRANT -c -o main.o main.cpp
g++ -I../src -I. -std=c++11 -O3 -I/usr/local/include/libusb-1.0 -I/usr/include/SDL2 -D_REENTRANT -c -o ../src/ps3eye_capi.o ../src/ps3eye_capi.cpp
g++ -I../src -I. -std=c++11 -O3 -I/usr/local/include/libusb-1.0 -I/usr/include/SDL2 -D_REENTRANT -c -o ../src/ps3eye.o ../src/ps3eye.cpp
g++ -o ps3eye_sdl main.o ../src/ps3eye_capi.o ../src/ps3eye.o -L/usr/local/lib -lusb-1.0 -lSDL2
/usr/bin/ld: ../src/ps3eye.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
makefile:34: recipe for target 'ps3eye_sdl' failed
make: *** [ps3eye_sdl] Error 1

After digging around, I added the -pthread flag to the makefile like so:

# Also SDL 2.0, e.g. via MacPorts or Homebrew
CXXFLAGS += $(shell sdl2-config --cflags)
LIBS += $(shell sdl2-config --libs) -pthread
endif

Now it compiles fine. However, if I try to then run the example, I get the following error:

$ sudo ./ps3eye_sdl
Segmentation fault

I looked in the source code and it seems to be falling over writing to the sccb_reg, but I'm out of my depth here and don't really know what that is. Any help would be appreciated! Is there a fundamental reason why it won't work on linux?

PS. Both my PSEye cameras are definitely plugged in and recognized by the system (I can view them using vokoscreen for example). And if I unplug them, it will throw the No PS3 Eye camera connected
error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions