Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. makefile problem

makefile problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    ns
    wrote on last edited by
    #1

    new to makefiles. Heres my problem: I used an xstring (custom) object in a class myClass, which has a functionality test fMyClass. In the makefile I did: fMyClass.x: $(proj)/fMyClass.o myclass.o $(CC) -o fMyClass.x fMyClass.o myclass.o fMyClass.o: $(proj)/fMyClass.cpp $(CC) -c $(incpath) $(proj)/fMyClass.cpp myClass.o: $(proj)/myclass.h $(proj)/myclass.cpp $(cpp)/xstring.h $(cpp)/xstring.cpp $(CC) -c $(incpath) $(proj)/myclass.cpp $(cpp)/xstring.cpp and it gives me errors like: Undefined first referenced symbol in file operator<<(ostream &, XString const &)myclass.o XString::~XString(void) myclass.o XString::XString(char const *) myclass.o I do have xstring.h included in myclass.cpp. What do I need to fix here? The fMyclass doesnt use xstring, but myclass does. thanks, ns

    J 1 Reply Last reply
    0
    • N ns

      new to makefiles. Heres my problem: I used an xstring (custom) object in a class myClass, which has a functionality test fMyClass. In the makefile I did: fMyClass.x: $(proj)/fMyClass.o myclass.o $(CC) -o fMyClass.x fMyClass.o myclass.o fMyClass.o: $(proj)/fMyClass.cpp $(CC) -c $(incpath) $(proj)/fMyClass.cpp myClass.o: $(proj)/myclass.h $(proj)/myclass.cpp $(cpp)/xstring.h $(cpp)/xstring.cpp $(CC) -c $(incpath) $(proj)/myclass.cpp $(cpp)/xstring.cpp and it gives me errors like: Undefined first referenced symbol in file operator<<(ostream &, XString const &)myclass.o XString::~XString(void) myclass.o XString::XString(char const *) myclass.o I do have xstring.h included in myclass.cpp. What do I need to fix here? The fMyclass doesnt use xstring, but myclass does. thanks, ns

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      Hi ns, Don't you need also to include an additional xstring.o entry and add it to fMyClass.x? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      N 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        Hi ns, Don't you need also to include an additional xstring.o entry and add it to fMyClass.x? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        N Offline
        N Offline
        nss
        wrote on last edited by
        #3

        Thats exactly it!! I had been trying different places to put in the xstring.o but it didnt occur to me to add it to the fMyClass.x line as well. Many many thanks! ns

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups