473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

linking problem

I am making a simple triangle using glut in a win32 app and am getting
an error

The error is this

Linking...
LIBCD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol
_WinMain@16 referenced in function _WinMainCRTStartup
Debug/glutpro.exe : fatal error LNK1120: 1 unresolved externals

here is the code

// glutpro.cpp : Defines the entry point for the console application.
//
#define WIN32_MEAN_AND_LEAN
#include "stdafx.h"
#include <Glut/glut.h>
#include<gl/gl.h>
#include<gl/glu.h>
#include<gl/glaux.h>
void display(void)
{
/* clear all pixels */
glClear (GL_COLOR_BUFFER_BIT);

/*Draw a white polygon (rectangle) with corners at
* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)
*/
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0);
glVertex3f(0.25, 0.75, 0.0);
glEnd();

/*don't wait start processing buffered OpenGL routines8*/
glFlush();
}

void init(void)
{
/*select clearing (background) color */
glClearColor(0.0, 0.0, 0.0, 0.0); //white

/*initialize veiwing values */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}

/*
*declare initial window size, position, and display mode
*(single buffer and rgba). Open window with "hello"
* in its title bar. Call initialization routines. Rt
* Register callback function to display graphics.
*Enter main loop and process events.
*/
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow("Hello");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0; //ISO C requires main to return int.
}

Please if anyone can help me I would really appreicate it
thank you for your time

W
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #1
2 2160
"woleksy" <wo*****@stmarys-ca-dot-edu.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
I am making a simple triangle using glut in a win32 app and am getting
an error

The error is this

Linking...
LIBCD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol
_WinMain@16 referenced in function _WinMainCRTStartup
Debug/glutpro.exe : fatal error LNK1120: 1 unresolved externals


Windowed applications begin (user code) at WinMain(). Console applications
begin at main(). You told the IDE that you were building a windowed
application. It is looking for WinMain which it can't find.

Create the project again and choose "New Console Project".

Regards,
Will
Nov 17 '05 #2
Thanks for the help that did work but now as soon as the window pops
up i get the error saying that this application has failed to start
because glut32.dll was not found. Re-installing the application may
fix this problem. I have glut32.dll in my bin folder in my vc7
folder in my visual studio.net is this the wronge place to have put
it, if so where should it be so that the compiler can find it and
create my program.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In...
27
by: Lee Phillips | last post by:
I believe it is universally accepted that decorating your website with images from someone else's, without permission, is rude and unethical, even if the images are in the public domain, because...
0
by: gasturbtec | last post by:
please help im new at access programming and i just got this project dropped in my lap because the old programmer quit. i've been doing ok so far but now i need to add code to an existing database...
18
by: Mark P | last post by:
I have a bit of vb code that uses Tables.Append to programatically link tables from Oracle and DB2 datasources. The problem I am having on some client machines is that the link will take anywhere...
17
by: Mitas Nikos | last post by:
I am trying to use the library conio2 and though I have managed with a few relatively simple examples when i try to compile a program which conio's function clrscr is not in main() i get an error...
1
by: buchalino | last post by:
Hi Guys, Please can someone help me, I am having a linking problem . I am writing a socket program, the problem is just the linking . I am using VC++ In the process of the problem, I...
5
by: news.microsoft.com | last post by:
We have recently upgraded from VS2002 to VS2005 and I'm having a problem with the linker always performing a full link even though nothing has changed. In searching the newsgroups I found that I...
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
0
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.