PDA

View Full Version : error opening opengl32.dll



ianbrown
08-24-2003, 08:26 AM
hi there.
i have VS6 and i keep getting this message

____________________________________________



--------------------Configuration: win_main - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "opengl32.dll"
Error executing link.exe.

win_main.exe - 1 error(s), 0 warning(s)

can any1 out there help me please http://www.opengl.org/discussion_boards/ubb/smile.gif

JotDot
08-24-2003, 08:42 AM
You link with opengl32.lib and glu32.lib, not the dll.

ianbrown
08-24-2003, 08:45 AM
when i link the .lib file i get this error

__________________________________________

--------------------Configuration: Main - Win32 Debug--------------------
Linking...
Main.obj : error LNK2001: unresolved external symbol "void __cdecl InitializeOpenGL(int,int)" (?InitializeOpenGL@@YAXHH@Z)
Main.obj : error LNK2001: unresolved external symbol "void __cdecl DeInit(void)" (?DeInit@@YAXXZ)
Main.obj : error LNK2001: unresolved external symbol "void __cdecl SizeOpenGLScreen(int,int)" (?SizeOpenGLScreen@@YAXHH@Z)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Main.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

Main.exe - 5 error(s), 0 warning(s)

mikael_aronsson
08-24-2003, 09:14 AM
Hi !

The first 3 are missing functions from some other library that you need to link your application, you have also tried to link your application as a console application (needs _main) but you don't have one, I guess you have a WinMain instead, that's fine but you need to use the correct options to the linker to make that work.

Mikael

ianbrown
08-24-2003, 09:32 AM
right this what im doing...

i got this source code from www.gametutorials.com (http://www.gametutorials.com)
i cant afford college so im on my own here http://www.opengl.org/discussion_boards/ubb/frown.gif

right this is what i do first.
i get the raw code form there site. http://www.gametutorials.com/download/OpenGL/FirstProgram_OGL.zip

i then compile it and here is the first error i get


--------------------Configuration: Main - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Main.exe - 2 error(s), 0 warning(s)


then i include opengl32.dll and glu32.dll in the project-->>setting>>>linker files tab

then i compile it and i get this

--------------------Configuration: Main - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "opengl32.dll"
Error executing link.exe.

Main.exe - 1 error(s), 0 warning(s)


THEN! i take out the opengl32.dll and glu32.dll in the linker tab and input opengl32.lib and glu32.lib and get this error

--------------------Configuration: Main - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Main.exe - 2 error(s), 0 warning(s)


and then i close everything coz im pissed off http://www.opengl.org/discussion_boards/ubb/smile.gif


help! please

chowe6685
08-24-2003, 09:39 AM
As was said, you have made a win32 application, and the compiler expects a win32 console application. Either create a win32 project, or replace your WinMain function with a main function

mikael_aronsson
08-24-2003, 09:56 AM
Hi again !

I don't have it in front of me, but there is an option to set console/windows app, I think the actual switch is /SUBSYSTEM:WINDOWS (to the linker)

Mikael

ianbrown
08-24-2003, 09:59 AM
now i get this ?

--------------------Configuration: iip - Win32 Debug--------------------
Compiling...
iip.cpp
c:\documents and settings\decon\desktop\lol\iip\iip.cpp(561) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

iip.obj - 1 error(s), 0 warning(s)


:S i dont know now http://www.opengl.org/discussion_boards/ubb/frown.gif

1234!
08-24-2003, 11:46 AM
Sorry if it comes across a bit harsh, but I strongly suggest that you learn what a compiler, a preprocessor and a linker does prior to learn OpenGL.

Starting with some basic or intermediate C++ couldnt hurt either.

If you already stumple over simple linker/preprocessor problems you want to improve your programming skills or you will run into major trouble sooner or later.

Regards.

mikael_aronsson
08-24-2003, 11:52 AM
The fun folks at microsoft always turn on precompiled headers for you so you have to either turn of "Pre compiled header (PCH)" in the compilers options or add the line:

#include "stdafx.h"

(I think they always call the file stdafx.h)

At the top of iip.cpp (must be first non comment line)

ianbrown
08-25-2003, 03:06 AM
ok this is something i just congured upp in about 20 minutes its not finished but tell me
am i using preproccesors here ?


//defines
#define END() <<endl<<endl;
#define LONG_LINE() cout<<"************************************************** ******************************"<<endl<<endl;
#define BLANK_LINE() cout<<" "<<endl<<endl;
#define GREEN() DrawColorString("",0,0,FOREGROUND_GREEN);
//includes
#include <iostream>
#include <string>
#include <fstream>
#include <windows.h>
#include <time.h>

using namespace std;




//initualizing colour*

void DrawColorString(string sztext, int X, int Y, WORD color)
{
HANDLE OutputH;
COORD position = {X, Y};
OutputH = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(OutputH, color);
SetConsoleCursorPosition(OutputH, position);
cout<<sztext;
}





int main(void)
{

//strings start********************************************* **************************************

string szname;
string szage;
string szgender;
string szlocation;
string szmaritalstatus;
string szcurrentemployment;
string szcurrentsalary;
string szexpectedsalary;
string szanswer;
string szusername;
string szpassword;
string szmenu;

//strings end*********************************************** **************************************

GREEN()


void DrawMenu();

{


LONG_LINE()

cout<<"* Welcome to the main menu *"<<endl;

LONG_LINE()
cout<<"* 1.)Register *"<<endl;
cout<<"* 2.)Log-in *"<<endl;
cout<<"* 3.)Change Username ans password *"<<endl;
cout<<"* 4.)Exit *"<<endl;

cout<<"Please Select a choice"END()

LONG_LINE()

cin>>szanswer;


}

if( ( szanswer == "1" ) &#0124; &#0124; ( szanswer == "1") )
{
cout<<"Thank you!"END()
cout<<"You will now be directed to the registration page"END()
cout<<"Please Wait"END()
Sleep(1500);
cout<<"Now Loading"END()
Sleep(1300);


LONG_LINE()
cout<<"* Please fill in the required questions *"END()

ofstream fout;
fout.open("user.txt");

//asking user for his.her name*
cout<<"What is your name"END()
cin>>szname;
fout<<"User: "<<szname<<endl;

//asking user for his/her age*
cout<<"What is your age"END()
cin>>szage;
fout<<"Age: "<<szage<<endl;

//asking user for his/her Location
cout<<"What is your current location <ie.UK,USA.ect>"END()
cin>>szlocation;
fout<<"Location: "<<szlocation<<endl;

//aking user to chose his/her username
cout<<"Please type in a user name that you will use to log on"END()
cin>>szusername;
fout<<"Username: "<<szusername<<endl;

//asking user to enter a password in with thay will use to log on
cout<<"Please enter a password"END()
cin>>szpassword;
fout<<"Password: "<<szpassword<<endl;

//returning to the main menu
cout<<"Thank you,you will now be transported back to the main menu"END()

fout.close();

}

if( ( szanswer == "2" ) &#0124; &#0124; ( szanswer == "2") )
{
cout<<"User name"END()
cin>>szusername;





}

if( ( szanswer == "3") &#0124; &#0124; ( szanswer == "3" ) )
{
cout<<"3"END()
}

if( ( szanswer == "4" ) &#0124; &#0124; ( szanswer == "4" ) )
{

return 0;
}

if( ( szanswer > "4" ) &#0124; &#0124; ( szanswer > "4") )
{
cout<<"!INVALID!,PLEASE CHOSE A ITEM FROM THE MENU!"END()
return 0;
}

return 0;
}

ianbrown
08-25-2003, 05:52 AM
thanks mr 1234 for the encouragment ???
2 days ive been doing this for gimme a break

Deiussum
08-25-2003, 06:40 AM
He's right, though. You should try to get some more basic C/C++ programming experience. The errors are telling you what's wrong, but you just aren't listening, or more likely, don't know how to interpret what it's telling you.

When a linker error says that you are missing function X, it means you are missing function X, either because it is part of a library you didn't include or because you didn't code it. So if it tells you you don't that the main or WinMain function is missing, you better code up a main or WinMain function depending on what it tells you.

1234!
08-25-2003, 08:05 AM
Originally posted by ianbrown:
ok this is something i just congured upp in about 20 minutes its not finished but tell me
am i using preproccesors here ?


//defines
#define END() <<endl<<endl;
#define LONG_LINE() cout<<"************************************************** ******************************"<<endl<<endl;
#define BLANK_LINE() cout<<" "<<endl<<endl;
#define GREEN() DrawColorString("",0,0,FOREGROUND_GREEN);


Yes you do, the #define's get expanded by the preprocessor. So very time you say "END()" in your code the preprocessor will replace that with "<<endl<<endl;".

Hope that helps.

1234!
08-25-2003, 08:12 AM
Originally posted by ianbrown:
thanks mr 1234 for the encouragment ???
2 days ive been doing this for gimme a break

You misunderstood me. All I am saying is that this is the wrong forum for c++ beginners questions.
The name of the forum is "OpenGL coding: beginners" that means beginners to OpenGL development, not for people who begin to code.

Hope that clears it up.

ianbrown
08-25-2003, 08:41 AM
hi 1234
i understand pre-proccesors.
yeah maybe i was trying to run b4 i could walk,i ordered a book from amazon.co.uk for beginner programmers c++ and VB,i will study that book back to front.thanks for the help anyways,i just wanted to try out opengl for the hell of it but ill study codeing solid first..thanks :P

Deiussum
08-25-2003, 09:30 AM
Understanding of pre-processor directives isn't the same thing as understanding the process of compiling and linking. And it obviously wasn't enough for you to understand what the linker was telling you.

I don't mean to be mean. There are just a lot of concepts you should understand before trying to get too deep into OpenGL. And it's good that you are taking the first steps to understanding programming. I can also understand wanting to jump right into something fun like OpenGL, but by trying to do that, you are going to cause yourself a lot more headaches than if you took the time to learn the basics first.

Good luck!

1234!
08-25-2003, 11:27 AM
Originally posted by ianbrown:
hi 1234
yeah maybe i was trying to run b4 i could walk,i ordered a book from amazon.co.uk for beginner programmers c++ and VB,i will study that book back to front.thanks for the help anyways,i just wanted to try out opengl for the hell of it but ill study codeing solid first..thanks :P

Thats sounds great. I am sorry if I came across rude I did not mean to. After all, I once was a C/C++ beginner too.

When you got the hang of C++ and the Visual Studio you are more then welcome on this board so we can have some fun with OpenGL http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Regards,

ianbrown
08-26-2003, 02:42 AM
dude im more than welcome any way ?

Latrans
08-26-2003, 04:30 AM
Dude, what are you? 12? People give you constructive criticism and you're like, "I can do what I want if I wanna..." Grow up.

Next you'll be asking about pointers and object-oriented paradigms...

ianbrown
08-27-2003, 03:05 AM
no no!! i didnt mean it like that dude sorry.
it came out wrong! lol what i meant to say was."yeah thanks i know im welcome and will be back when i get better" real sorry if it came out bad,it does look bad i know but i didnt mean it that way..real sorry ( i was very tyred when i typed that ) sorry man i didnt mean it like that.im really thankful for any help and any remarks...sorry...but hay guess what..i push my brain to a limit today..and its working now! http://www.opengl.org/discussion_boards/ubb/biggrin.gif i got it to work i didnt include the libarys in the VS folder and i disnt like the files right.but i have it now and its looking ok..thanks again ppl,and sorry 1234 i didnt mean it that way http://www.opengl.org/discussion_boards/ubb/wink.gif thanks for your help really. you got me thinking and thats how i figured it all out... http://www.opengl.org/discussion_boards/ubb/wink.gif
ian...