Jump to content
  • Advertisement
Sign in to follow this  
Twisol

Problems with Lesson 6 and up

This topic is 4814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't compile any tutorial code other than Lessons 1-5, as Dev-C++ is geting me tons of linker errors. Here's my error log, with repeated enries taken out...
  [Linker error] undefined reference to `_imp__CreateCompatibleDC@4' 
  [Linker error] undefined reference to `_imp__CreateDIBSection@24' 
  [Linker error] undefined reference to `_imp__SelectObject@8' 
  [Linker error] undefined reference to `_imp__SetDIBits@28' 
  [Linker error] undefined reference to `_imp__GdiFlush@0' 
  [Linker error] undefined reference to `_imp__DeleteDC@4' 
  [Linker error] undefined reference to `_imp__DeleteObject@4' 
  [Linker error] undefined reference to `_imp__GetStockObject@4' 
  [Linker error] undefined reference to `_imp__SetPaletteEntries@16' 
  [Linker error] undefined reference to `_imp__GetPaletteEntries@16' 
  [Linker error] undefined reference to `_imp__SelectPalette@12' 
  [Linker error] undefined reference to `_imp__RealizePalette@4' 
  [Linker error] undefined reference to `_imp__SetSystemPaletteUse@8' 
  [Linker error] undefined reference to `_imp__CreatePalette@4'   
  [Linker error] undefined reference to `_imp__DescribePixelFormat@16' 
  [Linker error] undefined reference to `_imp__UnrealizeObject@4' 
  [Linker error] undefined reference to `_imp__GetPixelFormat@4' 
  [Linker error] undefined reference to `_imp__DescribePixelFormat@16' 
  ld returned 1 exit status


:(

Share this post


Link to post
Share on other sites
Advertisement
Im also using Dev C++ and the same problem happened to me at that step. At the bottom of each lesson there is a code for each of the compilers there, most of the beginning ones are Dev, and others are compilers like Microsoft Visual, so make sure to download a translated Dev code and not to download another one becasue dev will read it as nonsense that will not compile.

Share this post


Link to post
Share on other sites
sorry let em rephrase my second sentence. I was using Open GL when that happened. but at the end of each lesson there is a list of compilers that has the exact definition of code but translated in a way each compiler can read it as. I think all of the lessons has Visual in their list while soem has Dev.

Share this post


Link to post
Share on other sites
Relpats_eht (backwords "the_stapler? :P), I'm including these flags: -lgdi32 -lopengl32 -lglu32 -lglaux

Ender: Tutorial 6 of NeHe's tutorials.

Lasko: I downloaded Lesson 6 and tried compiling, but I still get these linker errors.

Share this post


Link to post
Share on other sites
Ok, someone on cprogramming.com's forums helped me fix it. But now when I run the Lesson 6 code, it says "Initialization Error". I think the problem's originating here:


int LoadGLTextures() // Load Bitmaps And Convert To Textures
{
int Status=FALSE; // Status Indicator

AUX_RGBImageRec *TextureImage[1]; // Create Storage Space For The Texture

memset(TextureImage,0,sizeof(void *)*1); // Set The Pointer To NULL

// Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit
if (TextureImage[0]=LoadBMP("Data/NeHe.bmp"))
{
Status=TRUE; // Set The Status To TRUE

glGenTextures(1, &texture[0]); // Create The Texture

// Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}

if (TextureImage[0]) // If Texture Exists
{
if (TextureImage[0]->data) // If Texture Image Exists
{
/////////////////////////////////////////////////////////// ////////////////////////////////
free(TextureImage[0]->data); // Free The Texture Image Memory
}

free(TextureImage[0]); // Free The Image Structure
}

return Status; // Return The Status
}



I think the first "if" isn't going through, and that's why it's returning false to InitGL(), which in turn returns false to CreateGLWindow(), which returns false to WinMain(), thus closing the program...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I compared your snippet to my code, but what you've shown is identical to my code (which does compile within devcpp). It must be something else.
You did remember to set the project as Win32 GUI, right?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I just happened to see a nearly identical post (initialization error).
You do have your texture available, right? Within the specified directory "Data/NeHe.bmp", remembering that the name is case-sensitive, and this will search the same directory the .exe is running from for the data directory.

If I remember right, I started out with this problem. The downloadable code from the nehe site has the texture available if you don't know how to make it, or don't feel like making it (heh, I'm a little bit of A, and a little bit of B, personally).

Share this post


Link to post
Share on other sites
I downloaded the Lesson 6 code directly from its lesson page. And yes, I have the Windows GUI selected (that's how I got past the linker errors just now), and yes, I downloaded the Dev-C++ code and not another compiler's code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!