Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't include .h file in several .h files #28

Open
MatisFactory opened this issue May 9, 2020 · 4 comments
Open

Can't include .h file in several .h files #28

MatisFactory opened this issue May 9, 2020 · 4 comments

Comments

@MatisFactory
Copy link

When i'm try to include OBJ_Loader.h in several another h files linker throw:
Error LNK1169 one or more multiply defined symbols found main

@MatisFactory
Copy link
Author

It error can fix by adding cpp file and transfer implementation to it. .h file should contain only declaration

@Gashmoh
Copy link

Gashmoh commented Jun 11, 2020

Could you please upload .cpp and .h files ? Can't find a way to do it correctly.

@caseyuhrig
Copy link

I just fixed this issue on my local copy. Just add the inline keyword to all the methods that are not in a class declaration in the .h file. I'm new to git and not quite sure how to submit a change :) Some of the methods already have the inline keyword, so guessing it was just left out by accident on some. This is supposed to by a header only implementation, so guessing adding inline is the correct way to go!

@Mine268
Copy link

Mine268 commented Apr 22, 2023

I did it by extracting the funciton implementation to cpp file, here is it: https://pastebin.ubuntu.com/p/SByYj2YXy8/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants