Why do you #include lines.cpp in ThreeD.cpp? This is very unusual.
Your makefile wants lines.o, so you’re going to compile lines.cpp. Anything defined in lines.cpp will be in lines.o and also in ThreeD.o.
There is an intriguing comment in lines.cpp:
Don't forget to put declarations in your .h files.
I think the instructor wants you to break lines.cpp into a .h and a .cpp.
Excerpt from lines.cpp:
/* These go in your .h file or in lines.h */ /* Line drawing header. */ void draw_line(float, float, float, float); int near_far_clip(float, float, float *, float *, float *, float *, float *, float *);
I suspect that these two declarations are the only thing that should be in lines.h.
Related Posts:
- C Linking Error: undefined reference to ‘main’
- Why does fatal error “LNK1104: cannot open file ‘C:\Program.obj'” occur when I compile a C++ project in Visual Studio?
- gcc: undefined reference to
- Telling gcc directly to link a library statically
- How do I find the length of an array?
- C++ — expected primary-expression before ‘ ‘
- Using getline() with file input in C++
- lvalue required as left operand of assignment error when using C++
- g++ ld: symbol(s) not found for architecture x86_64
- Making my own toString() method on c++ struct
- Struct Constructor in C++?
- What is meant with “const” at end of function declaration? [duplicate]
- What’s the C++ version of Java’s ArrayList
- How do I iterate over the words of a string?
- How to declare a global variable in C++
- C++ Vector of pointers
- error: lvalue required as unary & operand
- What is use of c_str function In c++
- Is there a decent wait function in C++?
- What does T&& (double ampersand) mean in C++11?
- Segmentation Fault (core dumped) C++
- C++ – No matching member function for call to ‘push_back’
- error: lvalue required as unary & operand
- C/C++ JSON parser
- C++ Parsing input string to variables
- Is there a function to copy an array in C/C++?
- C++ error: no matching constructor for initialization of
- Why use string::iterator rather than index?
- C++ request for member ‘’ in ‘’, which is of non-class type ‘’
- Using O_RDWR vs O_RDONLY | O_WRONLY
- How to implement the factory method pattern in C++ correctly
- c++ array – expression must have a constant value
- getline() does not work if used after some inputs
- Passing a 2D array to a C++ function
- ‘typeid’ versus ‘typeof’ in C++
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- Thread pooling in C++11
- Callback functions in C++
- Reading from text file until EOF repeats last line
- How to iterate over a vector?
- What are the differences between struct and class in C++?
- What is ‘\0’ in C++?
- Generate random float between two floats
- What is std::move(), and when should it be used?
- Undefined reference to class constructor, including .cpp file fixes
- Deleting a dynamically allocated 2D array
- How to add element to C++ array?
- Difference of keywords ‘typename’ and ‘class’ in templates?
- Error: Jump to case label in switch statement
- What does int & mean
- Split a string into an array in C++
- C++ Why Is There “Unknown Type” When Class Header is Included?
- Invalid conversion from “const char*” to “char” error [duplicate]
- Initializing a static std::map
in C++ - C++ strings and pointers
- delete vs delete[] operators in C++
- What is the preferred way to include error messages in C++?
- How to Convert a C++ String to Uppercase
- C++ Fractions Class
- #pragma once vs include guards?
- Debug vs Release in CMake
- C++ Remove punctuation from String
- C++ Initializing a Global Array
- How to convert an ASCII char to its ASCII int value?
- Warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11?
- C++ – pointer being freed was not allocated error
- Reference to non-static member function must be called
- Call to non-static member function without an object argument compiler error
- C++ compile time error: expected identifier before numeric constant
- How can I assign an array from an initializer list?
- I get this error: “glibc detected”
- How can I get and use the header file
in my C++ program? - cin.eof() functionality
- Implementing a tree in C++
- Drawing Circle with OpenGL
- Run-Time Check Failure #2 – Stack around the variable ‘foo’ was corrupted
- How to implement “Press Any Key To Exit”
- When to use “new” and when not to, in C++?
- “vector” was not declared in this scope
- Converting string to ASCII
- got “cannot appear in a constant-expression” when using template
- C++ ostream and ofstream conversions
- C++ discards qualifiers
- What is the source of the data for the ProgramFiles, ProgramW6432Dir, ProgramFilesDir (x86), CommonProgramFiles environment variables?
- C++ : Exception occurred in script: basic_string::_S_construct NULL not valid
- Error: “expected primary-expression before int”
- error C2065: ‘cout’ : undeclared identifier
- How to get the MD5 hash of a file in C++?
- C++ Error: Expected a type specifier
- Where to declare/define class scope constants in C++?
- Friend methods error
- Does WPF Work with C++?
- Multiple inputs on one line
- Why do I get: -9223372036854775808
- Return a 2d array from a function
- Linker error: “linker input file unused because linking not done”, undefined reference to a function in that file
- Compiler error C4430: missing type specifier – int assumed [duplicate]
- ‘&’ : illegal operation on bound member function expression [duplicate]
- Multiple definitions of “Main”
- Getting the error floating point exception: 8