Thread: Passing Parameters To SDL_CreateThread

  1. #16
    Registered User
    Join Date
    Jan 2014
    Posts
    139
    I am using codeblocks 13.12 on linux and your code does not compile for me.

    Thank you for replying but I have no idea why.

    I copy pasted your code 100% and got these errors

    Code:
    ThreadingTest/main.cpp|34|error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]|
    ThreadingTest/main.cpp|34|error: too many arguments to function ‘SDL_Thread* SDL_CreateThread(int (*)(void*), void*)’|

  2. #17
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    There it is.
    You are using an older version of SDL (or not SDL2).
    https://www.libsdl.org/release/SDL-1...atethread.html

    There are only 2 parameters. Drop the middle parameter, "TestThread".

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Passing on parameters
    By Allen in forum C++ Programming
    Replies: 8
    Last Post: 01-10-2012, 12:55 AM
  2. Passing along function parameters
    By FlyingIsFun1217 in forum C++ Programming
    Replies: 16
    Last Post: 12-31-2007, 04:43 AM
  3. Passing Parameters
    By fry in forum C++ Programming
    Replies: 2
    Last Post: 10-04-2002, 03:06 AM
  4. Passing parameters
    By pdstatha in forum C++ Programming
    Replies: 1
    Last Post: 06-30-2002, 10:07 AM
  5. Passing parameters to other programs...is it possible?
    By face_master in forum Windows Programming
    Replies: 3
    Last Post: 01-28-2002, 07:48 AM