Author Topic: Problem configuring C::B to do simple things  (Read 3113 times)

nmtservice

  • Guest
Problem configuring C::B to do simple things
« on: February 05, 2007, 07:32:23 pm »
Hi colleagues and gurus!!
I'm facing a very newbie problem because this is my first attempt to use a IDE, normally I fire things from the crude command line.
My setup is Xubuntu 6.10; gcc version 4.1.2 20060928 and C::B svn 3466

This is my C 101 svgalib program:
Code

#include <stdio.h>
#include <stdlib.h>
#include <vga.h>

int main(void)
{

vga_init();
vga_setmode(5);
vga_setcolor(4);
vga_drawpixel(10,10);

sleep(5);
vga_setmode(0);


printf("Hello world!\n");
return 0;
}

When i compile it from command line I type:
Code
raul@creta:~/pojectos/svtest$ gcc -O main.c -Lvga
and a.out is created without problems and it works!

But when tried to run from C::B I get:
Code
-------------- Build: Debug in svtest ---------------
Linking console executable: ./svtest
obj/Debug/main.o: In function `main':
/home/raul/pojectos/svtest/main.c:8: referencia a `vga_init' sin definir
/home/raul/pojectos/svtest/main.c:9: referencia a `vga_setmode' sin definir
/home/raul/pojectos/svtest/main.c:10: referencia a `vga_setcolor' sin definir
/home/raul/pojectos/svtest/main.c:11: referencia a `vga_drawpixel' sin definir
/home/raul/pojectos/svtest/main.c:14: referencia a `vga_setmode' sin definir
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
5 errors, 0 warnings

Which in english means that no vga library was recognized or loaded

vga.h (and others svgalib development files ) are located in rigth places
Code
raul@creta:~$ whereis vga.h
vga: /etc/vga /usr/include/vga.h /usr/share/man/man4/vga.4.gz

So, How can I tell C::B where go to load vga or another non trivial libraries/headers?

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Problem configuring C::B to do simple things
« Reply #1 on: February 05, 2007, 07:41:40 pm »
Hi

just go to "Project"->"Build Options"->"Linker"->"Link libraries" and "Add" your library "vga".

nmtservice

  • Guest
Re: Problem configuring C::B to do simple things
« Reply #2 on: February 06, 2007, 03:55:35 pm »
Thanks!