Git Product home page Git Product logo

numerical-recipes's Issues

Including interp_1d in a big C++ project

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.