GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Jun-2004, 12:58
mikhail mikhail is offline
Junior Member
 
Join Date: Mar 2004
Location: Dublin, Ireland
Posts: 73
mikhail is on a distinguished road

Trouble with compiling/linking


Hi all,

Trying to use the http://www.hal9k.com/cug/links/subject73.htm here (near the bottom of the list), but I'm having some problems getting it to link. I've copied part of an old BGI program of mine, and I'm trying to get that much to work. Here's the basic code:

CPP / C++ / C Code:
#include <windows.h>
#include <stddef.h>
#include <stdio.h>
#include <math.h>

#include "graphics.h"

void main(void)
{
	/* request autodetection */
   int gdriver = DETECT, gmode, errorcode;
   int maxx, maxy;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk) {  /* an error occurred */
      printf("Graphics error: %s\n", grapherrormsg(errorcode));

      printf("Press any key to halt:");
      getch();
      exit(1);               /* terminate with an error code */
   }

   maxx = getmaxx();
   maxy = getmaxy();

   setbkcolor(BLACK);
   setcolor(WHITE);


   //Draw a dot
   outtextxy(maxx/2, maxy/2, ".");
   getch();
   clearviewport();

   closegraph();
}

I've got the winbgi graphics header and library files included as sub-nodes on the project window.

The problem is this:
I can compile the whole thing, but when I run it, I get an error message about "using a dummy version of OwlMain"
I tried downloading owl52f.dll (the right one, I'm sure), but that's not the problem.

Googling the problem turned up a lot of help, but most of it seems to be to change the targetexpert selection to "win32\console\owl". When I do that, or small variations (eg, leaving out the OWL check, or selecting GUI instead of console), I get linker errors about "Unresolved external '_main' referenced from <path>\C0X32.OBJ". Using main(), owlmain(), and winmain() as my main function name all seem to cause different (or the same) problems.

All of the help I've googled suggests changing the same settings back to what someone else has said is wrong (and which also isn't working for me).

Can anyone help?

Many thanks,
Mikhail
 
 

Recent GIDBlogFlickr uploads of IA pictures by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Having trouble with Galaga-game DWk C Programming Language 49 17-Feb-2005 08:10
Trouble With .htaccess amneziac85 Apache Web Server Forum 2 27-Jan-2004 17:35
Trouble connecting to most of the internet jrobbio Web Hosting Forum 7 18-Jan-2004 10:11
Trouble with htdocs on network drive. kibboy Apache Web Server Forum 0 11-Nov-2003 08:22
top menu bar trouble chalaska Web Design Forum 3 18-Jul-2002 21:11

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:28.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.