Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7993105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:45:09+00:00 2026-06-04T13:45:09+00:00

I have 3 files: Triliza.h, Triliza.cpp and Game.cpp. This is my makefile CC =

  • 0

I have 3 files: Triliza.h, Triliza.cpp and Game.cpp.
This is my makefile

CC = g++
prog: Game.o
    $(CC) Game.o -Wall -Werror -pedantic -o Triliza
Game.o: Game.cpp Triliza.h
    $(CC) -Wall -Werror -pedantic -c Game.cpp
Triliza.o: Triliza.cpp Triliza.h
    $(CC) -Wall -Werror -pedantic -c Triliza.cpp

This is my main file: Game.cpp

#include <iostream>
using namespace std;
#include "Triliza.h"

Triliza *triliza;

int main(int argc, char* argv[])
{
while (1)
{
    triliza = new Triliza();
    triliza->verifyFirstPlayer();
    triliza->loop();

    if (!triliza->playAgain())
        break;
}

return 0;
}

There is a error output:

g++ Game.o -Wall -Werror -pedantic -o Triliza
Undefined symbols:
"Triliza::Triliza()", referenced from:
  _main in Game.o
"Triliza::verifyFirstPlayer()", referenced from:
  _main in Game.o
"Triliza::loop()", referenced from:
  _main in Game.o
"Triliza::playAgain()", referenced from:
  _main in Game.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [prog] Error 1

So I suppose there are something wrong when I try to import each file together. Could anyone point me a correct way. Thanks

Edit: after changing there is another error came out.

make: *** No rule to make target `Trizilla.o', needed by `prog'.  Stop.

Thanks for all replies. I got it. because there is misspelling in Triliza

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:45:10+00:00Added an answer on June 4, 2026 at 1:45 pm

    You’re not linking in Triliza.o when the executable is built due to a dependency issue. Change the prog target as follows:

    prog: Game.o Triliza.o
        $(CC) Game.o Triliza.o -Wall -Werror -pedantic -o Triliza
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have files served like so: AJAX request handler -> Include file I would
Let's assume that I have files a.cpp b.cpp and file c.h. Both of the
In my Visual Studio 2010 project I have files with .mm file extension, that
I have files which contain file names pointing to other files. These files contain
Lets say I have files: Libs: one.cpp, one.h two.cpp, two.h three.cpp, three.h Program: program.cpp
Is there a way to have a git ignore file to ignore all files
I have files to serve. When user click the file how to generate a
I have been publishing my MVC3 project to IIS including All Project Files, this
Greetings. I have files that contains eleven fields in the file name. Each file
I have files that I want to delete. Connection can be from file sharing,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.