C++ Game Error.

  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7

103 Replies - 4660 Views - Last Post: 22 December 2017 - 10:07 AM Rate Topic: -----

#91 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1460
  • View blog
  • Posts: 4,726
  • Joined: 20-March 10

Re: C++ Game Error.

Posted 07 November 2017 - 03:03 PM

Well Xrey274,

There is no easy answer to that its really down to you and a question of better code organisation and style...

You need to read up on several things ....

Better computer program design principles

https://en.wikibooks...ming_Principles

and

an Introduction to computer game theory..

https://www.jesperju...mputergame.html

will certainly provide you with plenty of food for thought....
Was This Post Helpful? 1
  • +
  • -

#92 ndc85430  Icon User is online

  • I think you'll find it's "Dr"
  • member icon

Reputation: 798
  • View blog
  • Posts: 3,260
  • Joined: 13-June 14

Re: C++ Game Error.

Posted 07 November 2017 - 11:59 PM

Your first priority, though, really should be to go and learn the language properly.
Was This Post Helpful? 0
  • +
  • -

#93 Xrey274  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 222
  • Joined: 10-December 16

Re: C++ Game Error.

Posted 11 November 2017 - 04:15 PM

What do i need to learn specifically? What exact thing from the language do i need to learn, because i don't seem to know what i don't know. :unsure:/>

This post has been edited by Xrey274: 11 November 2017 - 04:19 PM

Was This Post Helpful? 0
  • +
  • -

#94 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 6158
  • View blog
  • Posts: 21,236
  • Joined: 05-May 12

Re: C++ Game Error.

Posted 11 November 2017 - 04:57 PM

There are two things you are missing to get to the point to be programming a game:

The first thing you are missing are the fundamentals of the language like syntax, declaring and calling functions, how to read error messages, user defined types, etc.

The second thing you are much missing is "how to think in C++". That mindset is a middle ground of the purely Object Oriented Programming point of view of Java programmers, and the eye for efficiency and procedural approaches of C programmers.
Was This Post Helpful? 1
  • +
  • -

#95 ndc85430  Icon User is online

  • I think you'll find it's "Dr"
  • member icon

Reputation: 798
  • View blog
  • Posts: 3,260
  • Joined: 13-June 14

Re: C++ Game Error.

Posted 12 November 2017 - 01:22 AM

I'm also curious as to how you've been learning C++, since any structured way of learning should have covered the things Skydiver mentioned. What kinds of materials are you using?

This post has been edited by ndc85430: 12 November 2017 - 01:37 AM

Was This Post Helpful? 0
  • +
  • -

#96 Xrey274  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 222
  • Joined: 10-December 16

Re: C++ Game Error.

Posted 21 November 2017 - 05:24 PM

I haven't changed the code at all, but i am getting 3 errors:

1.cannot find -lSDLmain
2.cannot find -lSDL
3.l returned l exit status.
Was This Post Helpful? 0
  • +
  • -

#97 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 6158
  • View blog
  • Posts: 21,236
  • Joined: 05-May 12

Re: C++ Game Error.

Posted 21 November 2017 - 05:46 PM

You may not have changed the program, but did you change the environment? Did you uninstall SDL? Did you change any environment variables? Did you move the location of your headers and libraries?

If you are not using a build script, makefile, or a project file, are you sure you are building exactly the same way as before?
Was This Post Helpful? 0
  • +
  • -

#98 Xrey274  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 222
  • Joined: 10-December 16

Re: C++ Game Error.

Posted 21 November 2017 - 05:47 PM

No i haven't. Unless i did something without realizing and remembering.
Was This Post Helpful? 0
  • +
  • -

#99 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 6158
  • View blog
  • Posts: 21,236
  • Joined: 05-May 12

Re: C++ Game Error.

Posted 21 November 2017 - 06:25 PM

The errors indicate that the linker cannot find the SDL related libraries. Something must have changed if the linker used to succeed, but now fails.
Was This Post Helpful? 0
  • +
  • -

#100 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1460
  • View blog
  • Posts: 4,726
  • Joined: 20-March 10

Re: C++ Game Error.

Posted 21 November 2017 - 09:38 PM

You might have changed from debug to release or vice versa

try changing whatever mode you are in to the opposite one.
Was This Post Helpful? 0
  • +
  • -

#101 ndc85430  Icon User is online

  • I think you'll find it's "Dr"
  • member icon

Reputation: 798
  • View blog
  • Posts: 3,260
  • Joined: 13-June 14

Re: C++ Game Error.

Posted 21 November 2017 - 10:56 PM

So, you're going to ignore the advice about learning the language and forge ahead? Good luck, I guess.
Was This Post Helpful? 0
  • +
  • -

#102 Xrey274  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 222
  • Joined: 10-December 16

Re: C++ Game Error.

Posted 01 December 2017 - 03:18 PM

I am not just trying understand why the game isn't compiling.
Was This Post Helpful? 0
  • +
  • -

#103 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 6158
  • View blog
  • Posts: 21,236
  • Joined: 05-May 12

Re: C++ Game Error.

Posted 01 December 2017 - 04:49 PM

You know the drill. Post your current code and the errors and warnings you are getting. We are not clairvoyant or super Russian hackers. We can't see what is on your computer.
Was This Post Helpful? 0
  • +
  • -

#104 Xrey274  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 222
  • Joined: 10-December 16

Re: C++ Game Error.

Posted 22 December 2017 - 10:07 AM

I reinstalled Code::Blocks twice, deleted all of my projects and started a brand new one still getting the same errors.

main.cpp
#include <iostream>

using namespace std;

int main()
{
    string player_name;

    cout<<"Please enter your name: ";cin>>player_name;

    return 0;
}




Ok i found out the problem. In the compiler settings, under linkers I had inlcluded the sdl linkers, but I deleted SDL a long while ago. Idk why it started making a problem now.
Was This Post Helpful? 0
  • +
  • -

  • (7 Pages)
  • +
  • « First
  • 5
  • 6
  • 7