Results 1 to 5 of 5

Thread: C2660 with CL_Thread::start

  1. #1

    Default C2660 with CL_Thread::start

    Hello,

    The problem I've encountered is with CL_Thread::start which I've based off of the Threading example.

    http://www.clanlib.org/docs/clanlib-...threading.html

    Code:
    int CChessGame::main( const std::vector<CL_String> &args )
    {
    
    	// ClanLib Setup modules
    	CL_SetupCore	setup_core;
    	CL_SetupNetwork setup_network;
    	CL_SetupDisplay setup_display;
    
    #ifdef USE_OPENGL_2
    	CL_SetupGL setup_gl;
    #endif
    
    	CNetwork network;
    
    	// Start the application
    	CApplication app;
    
    	CL_Thread appThread, netThread;
    	appThread.start( &app, &CApplication::Execute, args );
    	netThread.start( &network, &CNetwork::Execute, args );
    	appThread.join();
    	netThread.join();
    	return 0;
    }
    I've looked over the page multiple times to see if I'm missing anything, as well as searching the forums with the keywords cl_thread.

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    It looks okay.

    Code:
    	appThread.start( &app, &CApplication::Execute, args );
    	netThread.start( &network, &CNetwork::Execute, args );
    But ensure that:

    void CApplication::Execute( const std::vector<CL_String> &args ) {...}
    void CNetwork::Execute( const std::vector<CL_String> &args ) {...}

    Have the correct arguments.

  3. #3

    Default

    I have them already defined as

    Code:
    void CNetwork::Execute( const std::vector< CL_String >& args ) { ... }
    void CApplication::Execute( const std::vector< CL_String >& args ) { ... }

    Yet, the error still occurs.

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Try passing the args without reference

    void CNetwork::Execute( const std::vector< CL_String > args ) { ... }
    void CApplication::Execute( const std::vector< CL_String > args ) { ... }

  5. #5

    Default

    Okay, thanks that worked.

Similar Threads

  1. Novashell wont start: MAC Bug
    By baka_penguin in forum Novashell Game Creation System
    Replies: 7
    Last Post: 04-06-2008, 09:07 PM
  2. CL_Thread in ClanLib 0.8
    By Nikitto46 in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 06-07-2007, 03:57 AM
  3. Start each DMOD with no magic or weapons?
    By Newbie in forum Dink Smallwood HD
    Replies: 3
    Last Post: 02-21-2006, 01:40 AM
  4. Screwed Up! Do I Have to Start Over?
    By in forum Dink Smallwood HD
    Replies: 1
    Last Post: 01-05-2006, 03:09 PM
  5. Someone start a new TOURNEY server
    By in forum Funeral Quest
    Replies: 3
    Last Post: 04-08-2004, 09:44 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •