Click here to Skip to main content
15,891,993 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Any function to find the last modified time of a file? Pin
Don Box12-Jan-07 19:10
Don Box12-Jan-07 19:10 
AnswerRe: Any function to find the last modified time of a file? Pin
Mark Salsbery13-Jan-07 6:50
Mark Salsbery13-Jan-07 6:50 
AnswerRe: Any function to find the last modified time of a file? Pin
ThatsAlok14-Jan-07 19:58
ThatsAlok14-Jan-07 19:58 
QuestionConnecting oracle 9i in a WAN Pin
Karismatic12-Jan-07 17:32
Karismatic12-Jan-07 17:32 
AnswerRe: Connecting oracle 9i in a WAN Pin
Don Box12-Jan-07 22:48
Don Box12-Jan-07 22:48 
GeneralRe: Connecting oracle 9i in a WAN Pin
ThatsAlok14-Jan-07 19:56
ThatsAlok14-Jan-07 19:56 
AnswerRe: Connecting oracle 9i in a WAN Pin
S Douglas13-Jan-07 21:54
professionalS Douglas13-Jan-07 21:54 
QuestionFunction Redefinition Error [modified] Pin
Sauce!12-Jan-07 16:58
Sauce!12-Jan-07 16:58 
Hello, I am Sauce! and this is my first post on these forums. In my current project, I am using DirectX (specifically, D3D) to create a small 2D game. In the current stage of my project, I am setting up D3D to render textured quads, following along with the tutorial that can be found here, at www.gamedev.net.

I am getting two compile errors in my code, both of which are related; they are:

.\BiggerFish.cpp(114) : error C3861: 'Render2D': identifier not found


.\BiggerFish.cpp(204) : error C2365: 'Render2D' : redefinition; previous definition was 'formerly unknown identifier'

The first of these errors refers to my Render() function:

void Render()<br />
{<br />
    if( g_pd3dDevice == NULL )<br />
        return;<br />
<br />
    // Clear the backbuffer to a blue colour<br />
    g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );<br />
    <br />
    // Begin the scene<br />
    g_pd3dDevice->BeginScene();<br />
<br />
    // Render 2D items in the scene<br />
    Render2D();<br />
    <br />
    // End the scene<br />
    g_pd3dDevice->EndScene();<br />
    <br />
    // Present the backbuffer contents to the display<br />
    g_pd3dDevice->Present( NULL, NULL, NULL, NULL );<br />
}


and the second refers to my Render2D() function:

<br />
void Render2D()<br />
{<br />
	g_pd3dDevice->SetVertexShader(D3DFVF_PANELVERTEX);<br />
	g_pd3dDevice->SetStreamSource(0, g_pVertices, sizeof(PANELVERTEX));<br />
	g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 2);<br />
}


The compiler seems to think that I am redefining Render2D() when I call it on line 114 (in my Render() function), however I am not. Simply adding void in front of Render2D() when I call it eradicates this problem, however I believe that this is actually incorrect and the way my code is currently written is the correct way. Can anybody tell me the correct way to be doing this?

EDIT: I should probably point out that I am using Microsoft Visual C++ 2005 Express Edition. I have the Platform SDK installed, and the DirectX8 SDK.

-- modified at 23:08 Friday 12th January, 2007
AnswerRe: Function Redefinition Error Pin
PJ Arends12-Jan-07 18:26
professionalPJ Arends12-Jan-07 18:26 
AnswerRe: Function Redefinition Error Pin
Karismatic12-Jan-07 18:27
Karismatic12-Jan-07 18:27 
GeneralRe: Function Redefinition Error Pin
Sauce!12-Jan-07 19:59
Sauce!12-Jan-07 19:59 
QuestionChange button display Pin
samkook12-Jan-07 14:12
samkook12-Jan-07 14:12 
AnswerRe: Change button display Pin
PJ Arends12-Jan-07 14:23
professionalPJ Arends12-Jan-07 14:23 
AnswerRe: Change button display Pin
Hamid_RT12-Jan-07 17:30
Hamid_RT12-Jan-07 17:30 
AnswerRe: Change button display Pin
toxcct13-Jan-07 0:44
toxcct13-Jan-07 0:44 
GeneralRe: Change button display Pin
samkook13-Jan-07 7:01
samkook13-Jan-07 7:01 
GeneralRe: Change button display Pin
ThatsAlok14-Jan-07 19:55
ThatsAlok14-Jan-07 19:55 
GeneralRe: Change button display Pin
samkook15-Jan-07 7:15
samkook15-Jan-07 7:15 
QuestionClass Redefenition Problems Pin
CoffeeAddict1912-Jan-07 14:08
CoffeeAddict1912-Jan-07 14:08 
AnswerRe: Class Redefenition Problems Pin
PJ Arends12-Jan-07 14:29
professionalPJ Arends12-Jan-07 14:29 
GeneralRe: Class Redefenition Problems Pin
CoffeeAddict1913-Jan-07 5:27
CoffeeAddict1913-Jan-07 5:27 
QuestionPrevent a key to repeat Pin
Tjie Pouw12-Jan-07 12:35
Tjie Pouw12-Jan-07 12:35 
Answer[Message Deleted] Pin
WebsitesNG12-Jan-07 13:03
WebsitesNG12-Jan-07 13:03 
GeneralRe: Prevent a key to repeat Pin
Tjie Pouw13-Jan-07 4:51
Tjie Pouw13-Jan-07 4:51 
AnswerRe: Prevent a key to repeat Pin
PJ Arends12-Jan-07 13:27
professionalPJ Arends12-Jan-07 13:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.