Author Topic: Getting C++ working with libtcod (now with BearLibTerminal)  (Read 29906 times)

Kirbypowered

  • Newcomer
  • Posts: 14
  • Karma: +0/-0
    • View Profile
    • Email
Re: Getting C++ working with libtcod
« Reply #15 on: July 22, 2014, 01:29:24 PM »
Quote from: Cfyz
Quote from: Krice
Then, if some crappy library doesn't work, don't use it.
Yeah, use BearLibTerminal: linking is trivial, supports both MinGW and Visual C++ and does not require any recompiling :-P.
You know, why not? libtcod's just been problem after problem, and I'm starting to wonder why I was so set on using it. It's a shame I didn't get it working, but I'm not too disappointed. I'd like to think I've learned quite a bit from all of this. =P

I'll take a shot at using BearLibTerminal with mingw and Code::Blocks. I've been more interested in figuring out how things actually work than just having them work, which is sort of why I do most things through the console. Once I get a proper project running, I'll probably do so with an IDE for their ability to make life simpler.

Don't worry though, I'll have some more questions and problems ready before you know it. XP

Kirbypowered

  • Newcomer
  • Posts: 14
  • Karma: +0/-0
    • View Profile
    • Email
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #16 on: July 23, 2014, 02:26:21 AM »
Okay, seems I don't know crap about general library usage. How do I use BearLibTerminal? I tried testing the example code  from your site and I had strange issues relating to undefined references. I tried telling the compiler where the C header file was, and the linker where the .lib file was, but I'm not sure if that's enough. Also have the .dll in the directory. Might just be me missing important compiler commands (trying it with the console).

Edit: Okay yeah, definitely me doing something wrong with the compilation options. Got the program running through Code::Blocks. What would I be missing?
Code: [Select]
g++ bearlibtest.cpp -o bearlibtest -Iinclude -Llib(I put BearLibTerminal.c in /include and BearLibTerminal.lib in /lib)
« Last Edit: July 23, 2014, 02:39:01 AM by Kirbypowered »

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #17 on: July 23, 2014, 07:46:34 AM »
What would I be missing?

Common sense of not using IDE while it's easier than command line.

Cfyz

  • Rogueliker
  • ***
  • Posts: 194
  • Karma: +0/-0
    • View Profile
    • Email
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #18 on: July 23, 2014, 10:29:58 AM »
Quote from: Kirbypowered
What would I be missing?
Code: [Select]
g++ bearlibtest.cpp -o bearlibtest -Iinclude -Llib
You missed to mention the library: -lBearLibTerminal. The -I and -L switches are only telling where to look, not what to look for.
« Last Edit: July 23, 2014, 12:54:23 PM by Cfyz »

Cfyz

  • Rogueliker
  • ***
  • Posts: 194
  • Karma: +0/-0
    • View Profile
    • Email
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #19 on: July 23, 2014, 11:28:22 AM »
Quote from: Krice
Quote from: Kirbypowered
What would I be missing?
Common sense of not using IDE while it's easier than command line.
When trying out small code snippets It's often easier to type a single command line with few compiler switches than click your mouse to death setting up a new project in an IDE.

Kirbypowered

  • Newcomer
  • Posts: 14
  • Karma: +0/-0
    • View Profile
    • Email
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #20 on: July 23, 2014, 01:43:24 PM »
Quote from: Kirbypowered
What would I be missing?
Code: [Select]
g++ bearlibtest.cpp -o bearlibtest -Iinclude -Llib
You missed to mention the library: -lBearLibTerminal. The -I and -L switches are only telling where to look, not what to look for.
Ah, makes sense. I figured it was something like libtcod's -ltcod-mingw, but I didn't realize what it was doing.


What would I be missing?

Common sense of not using IDE while it's easier than command line.
Yeah yeah, you're probably right. I tend to be unreasonably opposed to common sense with a lot of things. XP But to be fair, I've only done small, basic programs up to this point where the command line was enough to easily get things running. I'm slowly making the transition to IDE, but I still like knowing how to set things up manually.

Anyhow, that should pretty much wrap up this thread. Never really did what I originally planned on, but BearLibTerminal seems good, especially since I actually got it working. =p Thanks a bunch for helping me people, especially Cfyz for putting up with my dumb questions the most.

Bear

  • Rogueliker
  • ***
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #21 on: July 23, 2014, 04:00:29 PM »
Even if you don't IDE, you can tuck all the command-line corners under the edges of a makefile and then just 'make' in the directory with the makefile will remember all those corners for you.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #22 on: July 24, 2014, 10:23:43 AM »
but I still like knowing how to set things up manually.

I think it's better to avoid any manual or extra work unless you need to learn something. Better tools make the actual work (game design) easier.

mushroom patch

  • Rogueliker
  • ***
  • Posts: 554
  • Karma: +0/-0
    • View Profile
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #23 on: July 24, 2014, 12:26:48 PM »
but I still like knowing how to set things up manually.

I think it's better to avoid any manual or extra work unless you need to learn something. Better tools make the actual work (game design) easier.

The downside of not learning to program using tools like the OP describes is that in 20 years of getting nothing done on IDEs, you might develop a sort of self-satisfied ignorance that makes you give bad advice to people trying do things properly. Admittedly, this situation isn't that common and lots of people get a lot done using IDEs, but such examples exist.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Getting C++ working with libtcod (now with BearLibTerminal)
« Reply #24 on: July 24, 2014, 05:33:53 PM »
people trying do things properly.

So, which one of you is trying to create a next gen major roguelike?