Strange Simple Error

This is a discussion on Strange Simple Error within the C Programming forums, part of the General Programming Boards category; Code: // check for an error during the load process if ( tex_2d == 0 ) printf( "SOIL loading error: ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    75

    Strange Simple Error

    Code:
    // check for an error during the load process 
    if ( tex_2d == 0 )
    printf( "SOIL loading error: '%s'\n", SOIL_last_result() );

    \visual studio 2005\projects\domino\domino\domino.cpp(264) : error C2059: syntax error : 'if'
    I can't figure out how to solve this one.

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    More code required. Especially the preceeding lines.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    75
    Code:
    GLuint tex_2d = SOIL_load_OGL_texture
    	(
    		"img",
    		SOIL_LOAD_AUTO,
    		SOIL_CREATE_NEW_ID,
    		SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
    	);
    	
    /* check for an error during the load process */
    if( 0 == tex_2d )
    {
    	printf( "SOIL loading error: '%s'\n", SOIL_last_result() );
    }
    There isn't more than this. All the other part of the program are working fine.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    And you have a file called "img", with no extension and that contains suitable data of a kind that the application can load?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    75
    And you have a file called "img", with no extension and that contains suitable data of a kind that the application can load?
    even with an extension I get the same error.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Try printing the result message:
    Code:
    printf("SOIL loading error: '%s'\n", SOIL_last_result());
    Shamelessly copied from
    http://www.idevgames.com/forum/showthread.php?t=15406

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  3. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 02:49 PM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21