Sign in to follow this  

What do you do?

This topic is 4852 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

What do you do when you encounter a linking problem? The reason I ask is becuase I seem to encounter them all the time and I have yet to find a good metodology for dealing with them. Also is there any good references of what errors the g++ compiler can give and what to do about them? Oh and in case someone has had the same problem as me here is the stack trace:
  [Linker error] undefined reference to `fseeko64' 
  [Linker error] undefined reference to `ftello64' 
  [Linker error] undefined reference to `fseeko64' 
  [Linker error] undefined reference to `fseeko64' 
  [Linker error] undefined reference to `inflateInit2_' 
  [Linker error] undefined reference to `inflateEnd' 
  [Linker error] undefined reference to `inflateReset' 
  [Linker error] undefined reference to `inflate' 
 D:\My documents\coding\c++\HeroQuest w SDL&GL\Makefile.win [Build Error]  [HeroGate.exe] Error 1 

I'm using Dev-C++ 4.9.9.0 as an IDE and the SDL/GL/FTGL/OpenIL libraries for the game.

Share this post


Link to post
Share on other sites
Well I'm too drunk to go into detail but there are 2two main linker errors that I encounter...

1. Undefined reference

You have used a variable which is declared (i.e. has a type and a name) but not defined (i.e. it has no specific value). Search for all references to the name and give it a value at some point (this is probably easier with an IDE like Visual Studio)

2. Multiple definition

You have used a variable with more than one value assigned to it. Search for all references to the name and remove all occurances of a value being assigned to the var except for the first one the compiler will encounter.

This is not software development law... this is just my experience, and I am drunk. If you want a proper answer, search the net or ask a more specific question about the two link errors described above.

Share this post


Link to post
Share on other sites
The thing is that many times (like the example above) I don't have a clue what library to include for it to go away. I think that it comes from using fseek but I should only have to include <stdlib.h> for that right? And not some stdlib...

Share this post


Link to post
Share on other sites
If it's LINKER error,it's mean,you don't link with some neccessary libs,and you need to somehow modify your linker options.
edit:and if it's COMPILER error,you might need to include something.

In devC++ ,click at project--->project parameters--->parameters tab , then click at "add library" and add that library.
I don't sure what lib do you need. It depends to what files do you include.Maybe sdlXXXX.o or sdlXXXX.a or something related to FTGL or maybe OpenIL (don't know what OpenIL is)

Also make sure you link with default library(libc or something like that). Use google for "library", "linker" , .

Share this post


Link to post
Share on other sites
The thing is that I KNOW that the exact same linker options that I have on my project work on my desktop but I can't get it to work on my laptop. That's whats really bugging me about these linker errors... they appear on one machine but not the other.... right now I have to program via VNC which is not to recommend at a ½MB line....

Share this post


Link to post
Share on other sites

This topic is 4852 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this