Compiler Error Undefined Symbols
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site xcode linker error undefined symbols for architecture x86_64 About Us Learn more about Stack Overflow the company Business Learn more about
Linker Error Undefined Symbol In C
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss linker error undefined symbol _initgraph Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up c++ undefined symbol linker error undefined symbol in module when compiling up vote 2 down vote favorite FIXED: had the method twice in the header file I get the following error when trying to compile my project % make g++ -o p4 testTree.o tree.o node.o check.o Undefined first referenced symbol in file Tree::inTree(int) tree.o ld: fatal: Symbol referencing errors. No output written to p4 collect2: ld returned 1 exit status *** Error code 1
Linker Error Undefined Symbol _closegraph In Module
make: Fatal error: Command failed for target `p4' Makefile p4: testTree.o tree.o node.o check.o g++ -o p4 testTree.o tree.o node.o check.o testTree.o: testTree.cc tree.h node.h check.h g++ -c -Wall -Werror testTree.cc tree.o: tree.h tree.cc node.h check.h g++ -c -Wall -Werror tree.cc node.o: node.h node.cc check.h g++ -c -Wall -Werror node.cc check.o: check.h check.cc g++ -c -Wall -Werror check.cc clean: rm -f *~ *.o p4 Relevant code from tree.cc and tree.h: tree.cc ... bool Tree::inTree(int k) const { return locate(k,root) != NULL; } ... tree.h #ifndef TREE_H #define TREE_H #include "node.h" #include "check.h" using namespace std; class Tree { private: Node *root; public: Tree(); Tree(const Tree & t); const Tree & operator=(const Tree &t); friend ostream & operator<<(ostream &out, const Tree &t); bool inTree(int k) const; double & operator[](int k); double & operator[](int k) const; ~Tree(); bool inTree(int index); private: Node * locate(int k, Node *rt) const; ostream & display(ostream &out, Node *r, int dir=Node::L) const; void add(int k, Node*&r); void kill(Node *&rt); void copy(Node *rt, Node *&newRt); }; #endif I get the feeling that it's something really simple, but I can't seem to figure it out. c++ compiler-errors makefile undefined-symbol share|improve this q
Tutorials/Articles Search HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Non-*NIX Forums > Programming "undefined symbol" when trying to compile undefined symbol math c? User Name Remember Me? Password Programming This forum is for all programming undefined symbol c++ questions. The question does not have to be directly related to Linux and any language is fair game. Notices
Undefined Symbol Error In C
Welcome to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our http://stackoverflow.com/questions/15486797/c-undefined-symbol-when-compiling newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have http://www.linuxquestions.org/questions/programming-9/undefined-symbol-when-trying-to-compile-c-256994/ any problems with the registration process or your account login, please contact us. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 11-19-2004, 04:34 PM #1 SciYro Senior Member Registered: Oct 2003 Location: hopefully not here Distribution: Gentoo Posts: 2,038 Rep: "undefined symbol" when
View All Answers My Questions Articles Tutorial Tips, Tricks & Techniques News Database Support Community Forums Search Recent DiscussionsResourcesQuality PortalEvents CalendarEmbarcadero on YouTube Job BoardRegistered User DownloadsTrial Downloads Books Login Register HomeArticlesTips, Tricks & http://community.embarcadero.com/article/technical-articles/162-programming/14926-understanding-undefined-symbol-error-messages TechniquesPROGRAMMINGUnderstanding "Undefined Symbol" Error Messages. Understanding "Undefined Symbol" Error Messages. Written by Embarcadero USA. Posted in PROGRAMMING Technical Information Database TI688C.txt Understanding "Undefined Symbol" Error Messages. Category :General Platform :All Product :Borland C++ ALL Description: One of the most common error messages seen by developers using a C or C++ compiler is "undefined symbol." This document provides a general description of what causes undefined symbol error messages, as well as undefined symbol instructions on solving specific undefined symbol errors. UNDEFINED SYMBOL AT COMPILE TIME An undefined symbol at compile time indicates that the named identifier was used in the named source file, but had no definition in the source file. This is usually caused by a misspelled identifier name, or missing declaration of the identifier used. EXAMPLE 1: int main(void) { test = 1; return 0; } The code shown for example one error undefined symbol will cause an undefined symbol error message to be displayed because the variable "test" has not been declared in either a header file which has been included or in the actual code itself. EXAMPLE 2: int main(void) { int test; Test = 1; return 0; } The code shown for example one will cause an undefined symbol error message to be displayed because when the variable "test" was used it was misspelled. The misspelling was a capital 't' instead of a lower case 't'. EXAMPLE 3: int main(void) { int test; test = 1; return 0; } The code shown in example three has no errors and is an example of what must be done to resolve an undefined symbol error message. In the example here we simply made sure we have a definition for the integer test and that we spelled it the same at the time we used it. It's that simple! UNDEFINED SYMBOL AT LINK TIME When linking multi-file projects, the linker must resolve all references to functions and global variables shared between modules. When these references cannot be resolved, the linker generates an "undefined symbol" error message. This means that after searching all of the object files and libraries which are included in the link, the lin