Sign in to follow this  

Linker problem

This topic is 4832 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 don’t know if I accidentally changed something in my linker settings or what, but all of the sudden I am getting some linker errors. Here is the deal: I’ve got a header file called main.h where I keep all of my other headers and place inside my all of my .cpp files. Also in my main.h, I have a couple of functions defined(Normalize() and VectZero()). Now, I get linker errors saying that my functions have already been defined in someobject.obj . I don’t get it. A few moments ago everything compiled fine. Things went bad when I entered another function into main.h. I took it out, but everything is still screwed up.

Share this post


Link to post
Share on other sites
I'm going to guess that before they were being inlined, and something you did when you added the other function stopped the inlining of the functions.

Share this post


Link to post
Share on other sites
It sounds like that happened, even though I don’t quite know what you are talking about. What is inlining?

edit: is that where you put inline infront of a function so it doesn't jump over to the function or am I thinking of something else.

Share this post


Link to post
Share on other sites
If your running Visual studio you can do a build clean. That may help the problem where you take the function out of main.h, but it still gets errors.

Share this post


Link to post
Share on other sites
Alright, I've added the inline keyword to the functions and now it runs ok. Thanks. I'm just curious How adding the function got to one state where it would compile to a state where it wouldn't compile.

Share this post


Link to post
Share on other sites

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