Jump to content

  • Log In with Google      Sign In   
  • Create Account

tiresandplanes

Member Since 12 Jan 2013
Offline Last Active Aug 31 2013 10:40 AM

Topics I've Started

Need help with a library

29 August 2013 - 05:35 PM

I posted this in beginners originally but I felt like it'd get answered more quickly in here.

 

I'm making my first rogue-like using this http://www.kathekonta.com/rlguide/article1.html tutorial and I am having trouble with compiling it.

 

I'm using Visual studio 2010 and whenever I try to compile the program it comes up with something like "Could not open Console.lib and I'm not sure what I am doing incorrectly. Does the .lib file go into the resources folder in a project? when is says "Static library for the Console interface:" does that mean when I make the project I should make it a static library instead of a win32 console application?

 

Edit: I basically don't know how to link my library to my project file.

 

Edit: I think....

 

Edit: I got it linked but I keep getting this error

 

1>console.lib(Win32Console.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1>LINK : fatal error LNK1104: cannot open file 'LIBCD.lib'


Need help with a library

29 August 2013 - 05:16 PM

I'm making my first rogue-like using this http://www.kathekonta.com/rlguide/article1.html tutorial and I am having trouble with compiling it.

 

I'm using Visual studio 2010 and whenever I try to compile the program it comes up with something like "Could not open Console.lib and I'm not sure what I am doing incorrectly. Does the .lib file go into the resources folder in a project? when is says "Static library for the Console interface:" does that mean when I make the project I should make it a static library instead of a win32 console application?


Can someone tell me why this won't compile?(to do with strings, arrays, pointers)

13 February 2013 - 08:19 PM

For some reason this won't compile. This isn't the first time that something hasn't worked from this book so I suspect it's a tiny typo that is messing up the whole thing. Can someone explain to me why this doesn't compile? I'm just starting to deal with strings so I don't know how to call a function from within a string.

 

#include <stdio.h>

main ()

{ int str_number;

for (str_number = 0; str_number < 13; str_number++)
   {
   printf ("%s", menutext(str_number));
   }
}

/*********************************************************/

char *menutext(n)
int n;

{
  static char *t[] =
   {
   "  -------------------------------------- \n",
   " |            ++ MENU ++                |\n",
   " |           ~~~~~~~~~~~~               |\n",
   " |     (1) Edit Defaults                |\n",
   " |     (2) Print Charge Sheet           |\n",
   " |     (3) Print Log Sheet              |\n",
   " |     (4) Bill Calculator              |\n",
   " |     (q) Quit                         |\n",
   " |                                      |\n",
   " |                                      |\n",
   " |     Please Enter Choice              |\n",
   " |                                      |\n",
   "  -------------------------------------- \n"
   };
return (t[n]);
}



I get an error on line 15: char *menutext(n)

 

C:\Documents and Settings\Gary II\Desktop\cprog.c|15|error: conflicting types for 'menutext'|

 


Why isn't my array working?

11 February 2013 - 01:47 PM

Hi, I'm not sure why this isn't working. I define SIZE at the beginning but it seems not to work. I replaced SIZE with a different number and it worked fine. Why isn't it recognizing what SIZE is?

 

#include <stdio.h>

#define SIZE 10;

    main()
    {
        int i, array[SIZE];
    for(i = 0; i < SIZE; i++)
    {
    array[i] = 0
    }
    }

Errors I get:
C:\Users\Gary\Desktop\c\firstproga.c||In function 'main':|
C:\Users\Gary\Desktop\c\firstproga.c|7|error: expected ']' before ';' token|
C:\Users\Gary\Desktop\c\firstproga.c|8|error: expected expression before ';' token|
C:\Users\Gary\Desktop\c\firstproga.c|10|error: 'array' undeclared (first use in this function)|
C:\Users\Gary\Desktop\c\firstproga.c|10|note: each undeclared identifier is reported only once for each function it appears in|
C:\Users\Gary\Desktop\c\firstproga.c|11|error: expected ';' before '}' token|
||=== Build finished: 4 errors, 0 warnings (0 minutes, 0 seconds) ===|
 


Can someone mentor me?

12 January 2013 - 10:09 AM

I have never programmed before and chose C++ as my first language to start with.  So I'm learning to program and C++ at the same time. I chose C++ as my first language because I want to use it the most out of any programming  language and even though I know it's harder to do this, I felt that this was the right path for me. 

 

I was wondering if someone would mentor me. I am currently reading C++ Primer and some things I understand how to do, but not necessarily what the use for them are. I am about 100 pages in, It's starting to touch on vectors and iterators and arrays and pointers and even if I learn how to use them, I don't understand what they are used for. 

 

I'm basically looking for someone who will be able to explain to me the bigger picture of certain things (as it pertains to game making/programming in general). I've heard it's good to surround yourself with people (or a person) that is more experienced or an expert because you'll gradually get better just by being around them and talking to them.

 

Please don't recommend me learning a different higher-level language because I don't plan on changing to anything else.


PARTNERS