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

Including interp_1d in a big C++ project #2

Open
blindProgrammer opened this issue Oct 4, 2021 · 0 comments
Open

Including interp_1d in a big C++ project #2

blindProgrammer opened this issue Oct 4, 2021 · 0 comments

Comments

@blindProgrammer
Copy link

Hi, I have this issue when it comes to including the interp_1d header in a big c++ project. I have the following configuration, where each .hpp file shown below has a corresponding .cpp file:

myPulse.hpp:
#include "nr3.hpp"
#include "interp_1d.hpp"

calc1.hpp:
#include "myPulse.hpp"

calc2.hpp:
#include "myPulse.hpp

main.cpp:
#include "myPulse.hpp"
#include "calc1.hpp"
#include "calc2.hpp"
#include "nr3.hpp"
#include "interp_1d.hpp"

This returns the error: "66 duplicate symbols for architecture x86_64", where basically the contents of interp_1d.hpp are being read three times. The issue is resolved when I remove the interp_1d.hpp header from main and from myPulse.hpp header, and instead include it in myPulse.cpp, but this is a very dirty way of solving it and I still can only use it in myPulse.cpp.
I tried adding the following header guards to the interp_1d header:

#ifndef INTERP_1D_HPP
#define INTERP_1D_HPP

#endif

but it didn't fix the issue. Can someone help me with this issue? I basically want to use interp_1d techniques in multiple classes in my project but can't seem to be able to.

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

1 participant