Problem in tutorial 1

Started by
12 comments, last by nefthy 18 years ago
When i was download the NeHe Production tutorial 1 and try to compile with my Microsoft Visual Studio 6, it come out 2 error message which are: --------------------Configuration: Lesson1 - Win32 Debug-------------------- Linking... libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Lesson1.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Lesson1.exe - 2 error(s), 0 warning(s) Can anyone solve for me? pls help...
Advertisement
You compiled it as a win32console, console apps use the main() as a start point.
What you need to do is to compile it as a win32application, it uses winmain() as a entry point, which is what lesson 1 use.
If you don't feel like creating a whole new project, here are the instructions on changing a Console App into a Win32 App.
http://www.mvps.org/vcfaq/lang/5.htm
Oh great!! It solve my problem, now i can compile and run the program.

But another problem come out with Microsoft Visual Studio 8, which is the new version of visual studio 2005.

I open project with "Win32 Project" which is not project of Console Win32, and when compiling the tutorial 1, it come out many errors which are something like:

---------------------------------------------------------------------------------------------------------------------------------------
1. error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

2. error C2664: 'UnregisterClassW' : cannot convert parameter 1 from 'const char [7]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

3. error C2440: '=' : cannot convert from 'const char [7]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

4. error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

---------------------------------------------------------------------------------------------------------------------------------------

##in the tutorial 1 actual code is MessageBox, but is it the complier itself took it as MessageBoxW??? Take 1 example in the coding:

##MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);##

the debugger error on the ("Release Of DC And RC Failed.","SHUTDOWN ERROR") for cannot converting parameter 2 from const char to LPCWSTR... can any1 help??
I think language is just a tool,so you needn't change your tool frequent.The tool can finish your work best is the enough.(I am China So My English is poor,^_^)
Have a look at this thread, the poster had much the same issues as you have.

Hope that helps!
--
Cheers,
Darren Clark
Thanks Darren, i have solve the VS 2005 problem ad, thanks for all ur helping, now i can start learn all those tutorial...

Still...have any1 expert in OpenGL? i need urs expertise information. i was doing a project is about using OpenGL to develop a building block, i know it is very hard, but is that possible for a newbie done in 4~5 months? is that enough time for complete the project? the bulding block scope quite big....is about a College Academic block...

hear u soon, thanks
No problems Kevin, we all have to start somewhere [smile].

Well I'm definately not an expert in OpenGL but I'll offer you some advice on your project. Learning OpenGL to develop a set of buildings is certainly possible within the timeframe you mentioned but it really is dependent on how experienced you are with C++ (I assume that this the language you have chosen) and how fast a learner you are. You have two options when it comes to modelling your buildings, you can either specify how the buildings are made using pure code (very timeconsuming) or you are going to want to learn how to create models in a modelling package and then import them into an application which then displays them.

The slightly more difficult way will be to model the buildings in a modelling package such as Blender or Milkshape3D (these are just examples, there are loads to choose from) and then import these models into your application. It will be more difficult to write an importer for your models but the time you will save by being able to create buildings, trees and other stuff inside a package which was designed for that purpose can not be over-stressed.

If you want textures on your buildings and other models then you're going to need to write a texture loader or use a pre-built one such as DevIL to do some of the work for you.

In conclusion, if you're a confident coder and put a lot of energy and time into your project then sure, I think it would be possible to do it in 4-5 months.

I wish you the best of luck and if you have problems then have a look at the NeHe tutorials and articles, check Google and definately post back here for help and advice. Speak to you later [smile].
--
Cheers,
Darren Clark
Thanks for ur advice Darren.

But 1 thing that from my project, it only can use pure code to develop my project, becuase i'm having my software engineering degree, so i think i cannot have another choice (application sofware etc) except using coding...

From the C++ language, seriously i never learn before but, i had learn C before, so the coding for the C++ is still understandable for me.

I will try all my best, and any problem i will post in this forum, i really need all ur helps...and again, thx a million!;)
O yea Darren, do u have any website or references on how to code an bulding block for OpenGL? and 1 thing im might considering, as u say use pure code will very time-consuming, so how about i use the texture mapping techniques to build it? is that more easier? and any suggestion that i can learn more faster in OpenGL? (within my scope) becoz it i learn the Nehe tutorial lesson i dun think that is enough information for me...and Thanks again~~~ :)

This topic is closed to new replies.

Advertisement