Author Topic: Getting GRX to work with Code::blocks?  (Read 12681 times)

Offline mconsidine

  • Multiple posting newcomer
  • *
  • Posts: 10
Getting GRX to work with Code::blocks?
« on: August 20, 2007, 12:48:24 am »
Apologies in advance if this is not the right place for this question.  Having checked the archives, though, I can't think of where else to ask.

I am returning to some programming after a long lay off and want to get a borland/graphics.h type app recompiled using code::blocks.  The GRX graphics library found here http://grx.gnu.de/ would seem to allow that.  And it's install seems to work fine.

The problem is cropping up when I try to compile under cb (svn build #3337, Dec 4, 2006).  After copying the GRX header files to mingw/include and the library file to mingw/lib, I get the following errors :
:vd_win32.c:: undefined reference to `SetDIBColorTable@16'
:vd_win32.c:: undefined reference to `CreateDIBSection@24'
:vd_win32.c:: undefined reference to `SelectObject@8'
:vd_win32.c:: undefined reference to `CreateSolidBrush@4'
:vd_win32.c:: undefined reference to `DeleteObject@4'
:vd_win32.c:: undefined reference to `DeleteObject@4'
:vd_win32.c:: undefined reference to `CreateCompatibleDC@4'
:vd_win32.c:: undefined reference to `BitBlt@36'
:vd_win32.c:: undefined reference to `SetDIBColorTable@16'
:vd_win32.c:: undefined reference to `GetStockObject@4'
:vd_win32.c:: undefined reference to `DeleteObject@4'
:vd_win32.c:: undefined reference to `DeleteDC@4'
:vd_win32.c:: undefined reference to `BitBlt@36'
:fdw32_8.c:: undefined reference to `GetPixel@12'
:fdw32_8.c:: undefined reference to `SetPixelV@16'
:fdw32_24.c:: undefined reference to `GetPixel@12'
:fdw32_24.c:: undefined reference to `SetPixelV@16'
:: === Build finished: 17 errors, 0 warnings ===

My gut tells me I'm missing a compiler directive, but looking at the makefile that is with the GRX install doesn't seem to help.  (More likely : I'm completely overlooking something).

Can anyone here tell me what I'm likely doing wrong or missing?  Can anyone who has successfully integrated GRX with cb tell me what they did?

Thanks in advance,
Matt

(fwiw, running on cb on winxp)

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Getting GRX to work with Code::blocks?
« Reply #1 on: August 20, 2007, 08:01:48 am »
You need to link against libgdi32. Add "gdi32" to Build options->Linker settings->Link libraries.

Offline mconsidine

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Getting GRX to work with Code::blocks?
« Reply #2 on: August 21, 2007, 03:53:44 pm »
Thanks.  That did the trick ...

Den

  • Guest
Re: Getting GRX to work with Code::blocks?
« Reply #3 on: April 14, 2008, 01:02:29 pm »
I have a problem with the GRX library. I work os Windows XP Sp2.
I have downoload the GRX graphics library from http://grx.gnu.de/
I don't know how to instal this library.
Could anybody explain how to do it by steps?

Thank for attention.

Den.

Offline Deschamps

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Getting GRX to work with Code::blocks?
« Reply #4 on: April 14, 2008, 02:24:36 pm »
Hello.

Quote from: Den
I don't know how to instal this library.
Could anybody explain how to do it by steps?

1) Unzip the package you've downloaded
2) Look for a text file named 'readme'
3) Open and read it

4) If something fails, ask for help trying to provide all the info you think will be relevant, as the compiler you're using, etc.

Regards.
Misquotations are the only quotations that are never misquoted

Den

  • Guest
Re: Getting GRX to work with Code::blocks?
« Reply #5 on: April 14, 2008, 09:18:33 pm »
I have read Readme file.   
From Readme:
Quote
B. Compiling GRX
----------------

  1) Go to GRX base dir and edit "makedefs.grx" to customize it for
     your system.

  2) Switch to "src" sub dir

  3) run 'make -f <your makefile>':

     makefile.dj2 for DOS/DJGPPv2
     makefile.w32 for Win32/Mingw
     makefile.lnx for Linux/console
     makefile.x11 for Linux/X11
     makefile.sdl for SDL driver on MingW and X11

I work OS Windows XP, my makefile is "makefile.w32". What compiler I need to use?
I have tryed this - copyed file mingw32-make.exe to directory C:\grx248s\contrib\grx248\src\
Then at my CMD I typed
Quote
C:\grx248s\contrib\grx248\src>mingw32-make.exe -f makefile.w32
Quote
mingw32-make.exe -f makefile.w32 clean
mingw32-make.exe[1]: Entering directory `C:/grx248s/contrib/grx248/src'
if exist bgi\*.o      del bgi\*.o
if exist draw\*.o     del draw\*.o
if exist fdrivers\*.o del fdrivers\*.o
if exist fonts\*.o    del fonts\*.o
if exist image\*.o    del image\*.o
if exist gformats\*.o del gformats\*.o
if exist mouse\*.o    del mouse\*.o
if exist misc\*.o     del misc\*.o
if exist pattern\*.o  del pattern\*.o
if exist setup\*.o    del setup\*.o
if exist shape\*.o    del shape\*.o
if exist text\*.o     del text\*.o
if exist user\*.o     del user\*.o
if exist utils\*.o    del utils\*.o
if exist utilprog\*.o del utilprog\*.o
if exist vdrivers\*.o del vdrivers\*.o
if exist wideline\*.o del wideline\*.o
if exist ..\addons\*.o del ..\addons\*.o
if exist ..\addons\print\*.o del ..\addons\print\*.o
if exist ..\addons\bmp\*.o   del ..\addons\bmp\*.o
if exist systag.006       del systag.006
mingw32-make.exe[1]: Leaving directory `C:/grx248s/contrib/grx248/src'
if not exist systag.006 del systag.*
Не удается найти C:\grx248s\contrib\grx248\src\systag.*
echo WIN32_GCC_i386_STATIC_TARGET > systag.006
gcc -c -O2 -fno-strict-aliasing -Wall -I. -I./include -I../include -I../addons/p
rint -I../addons/bmp draw/bitblt.c -o draw/bitblt.o
process_begin: CreateProcess(NULL, gcc -c -O2 -fno-strict-aliasing -Wall -I. -I.
/include -I../include -I../addons/print -I../addons/bmp draw/bitblt.c -o draw/bi
tblt.o, ...) failed.
make (e=2): ═х єфрхЄё  эрщЄш єърчрээ√щ Їрщы.
mingw32-make.exe: *** [draw/bitblt.o] Error 2

C:\grx248s\contrib\grx248\src>

Can you tell me what I did wrong?


Thank for attention.

Den.

Offline codeur

  • Multiple posting newcomer
  • *
  • Posts: 113
    • Code::Blocks EDU-Portable
Re: Getting GRX to work with Code::blocks?
« Reply #6 on: April 16, 2008, 12:07:18 am »
Den,

Make is running OK, but it does not find the gcc compiler.
You need to compile under the MinGW compiler (the one that comes with Code::Blocks), but my guess is that you have a straight CB 8.02 install, therefore MinGW is there, OK for CB, but not ready to work as a standalone compiler.

Two possible solutions:
1- Install MinGW standalone (get from http://MinGW.org) and compile GRX with that, then install.
 or
2- I am right now preparing a GRX 2.4.8-with-SDL-driver binary bundle for a group of students who want to use GRX with CB. It should be ready late today. Send me a personal message and I'll give you the URL where to get it, with instructions to install it. It will be built for a stock-standard CB 8.02 installation on 32-bit Windows and will have support for BGI. It could be your lucky day (and at the same time you may help me test it).
--
  codeur
« Last Edit: April 16, 2008, 12:29:46 am by codeur »

multicoder

  • Guest
Re: Getting GRX to work with Code::blocks?
« Reply #7 on: April 21, 2009, 09:17:59 am »
Hi,
I am trying to build classic game of snake using Code:Blocks 8.02, for that I need graphics.h.
I searched the google for this n I got the grx .So I downloaded it,unzipped,looked for installation instructions too,I got read me file there!But  the contents of it look somewhat weird, as below -
##########################################################
      Printing from GRX 

This is source of beta version of printing procedures for GRX.
These procedures are based on sources of printer BGI drivers
for Borland C++ and Pascal compilers. This BGI driver was
developed by Ullrich von Bassevitz (see copying.uz).

Only part of sources of printer BGI driver are used. I didn't port
drawing functions from BGI driver as they are already implemented in GRX.
I took only printing part which is now rather heavily modified to get
rid of Borland C++ specific features (e.g. inline assembler).

Current version is tested with DJGPP and Linux versions of GRX only.
I didn't even try to compile it with Borland C++ for real mode as
I think it is useless due to lack of memory needed for buffer where
to create image. To print from GRX under Linux one should install
printer filter that allows to send PCL output to printer.

Only some modes are tested:
   Epson LQ printer : 180x180 dpi
        LaserJet 4L : 300x300 dpi (with and without compression)
   
I also tried DeskJet 500C mode (300x300 dpi with separate black)
on DeskJet 690C and it worked.

Printing code is linked into executable only when it is really required.
 
Currently it's included as addon to GRX.

--------------------  Files  -------------------------------------------
grxprint.c   - main sources of printing code
grxprint.h      - interface definitions for user
prndata.c       - printer definitions
grxprn00.h      - definitions used internally by grxprint only
printest.c      - test example
copying.uz      - original copyright notice from Ullrich von Bassevitz
printer.doc     - original docs on printer BGI driver
------------------------------------------------------------------------

NOTE:   Ullrich von Bassevitz is no more maintaining printer BGI driver.
        Addresses mentioned in printer.doc are NO MORE USABLE
###############################################################
This iswhat I got inside readme.txt and other readme files are not in the txt format!
I am new to Code:Blocks, so I am sure I am missing aomething.
Even I tied my luck for Code:Blocks' Plugins->manage Plugins option too, "install new" options too.
But all in vein!
Can somebody please help me,coz the joy I will get after watching my snake crawling around successfuly
cannot be compared with anything else!

Thanks & regards,
Multicoder

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Getting GRX to work with Code::blocks?
« Reply #8 on: April 21, 2009, 01:15:32 pm »
I am trying to build classic game of snake using Code:Blocks 8.02, for that I need graphics.h.
This is not related to C::B and thus violates our forum rules!

Grab yourself a package which includes graphics.h (and other files that are probably required, too) - but what package that is and how you get it I don't know and this is the wrong place to ask.

All I can tell: What you got does obviously *not* include graphics.h but seems to be a printer driver.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ