PDA

View Full Version : Export to OpenGL.... HELP



Erik
04-21-2001, 11:18 PM
I have created an scene in 3dSMAX, for export to vc++ (opengl code) I used the 3d Exploration. When I load it in VC ( I use VC6) it looks great, but when trying to create the program, it writes some errors...
------here is the report which it writes---
--------------------Configuration: Erda01 - Win32 Debug--------------------

Command Lines
Creating temporary file "C:\WINDOWS\TEMP\RSP1153.TMP" with contents
[
/nologo /MLd /W4 /Gm /GX /ZI /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/Erda01.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\3dsmax3\Scenes\Erik.cpp"
]
Creating command line "cl.exe @C:\WINDOWS\TEMP\RSP1153.TMP"
Output Window
Compiling...
Erik.cpp
C:\3dsmax3\Scenes\Erik.cpp(19) : error C2466: cannot allocate an array of constant size 0
C:\3dsmax3\Scenes\Erik.cpp(19) : error C2466: cannot allocate an array of constant size 0
C:\3dsmax3\Scenes\Erik.cpp(19) : error C2087: '' : missing subscript
C:\3dsmax3\Scenes\Erik.cpp(20) : error C2062: type 'float' unexpected
C:\3dsmax3\Scenes\Erik.cpp(222) : error C2065: 'PFD' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(222) : error C2061: syntax error : identifier 'MAIN_PLANE'
C:\3dsmax3\Scenes\Erik.cpp(229) : error C2501: 'nPixelFormat' : missing storage-class or type specifiers
C:\3dsmax3\Scenes\Erik.cpp(229) : error C2086: 'nPixelFormat' : redefinition
C:\3dsmax3\Scenes\Erik.cpp(229) : error C2065: 'hdc' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(229) : error C2065: 'pfd' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(230) : error C2501: 'SetPixelFormat' : missing storage-class or type specifiers
C:\3dsmax3\Scenes\Erik.cpp(230) : error C2373: 'SetPixelFormat' : redefinition; different type modifiers
c:\program files\microsoft visual studio\vc98\include\wingdi.h(3262) : see declaration of 'SetPixelFormat'
C:\3dsmax3\Scenes\Erik.cpp(230) : error C2078: too many initializers
C:\3dsmax3\Scenes\Erik.cpp(230) : error C2440: 'initializing' : cannot convert from 'int *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\3dsmax3\Scenes\Erik.cpp(232) : error C2143: syntax error : missing ';' before 'if'
C:\3dsmax3\Scenes\Erik.cpp(232) : error C2143: syntax error : missing ';' before '{'
C:\3dsmax3\Scenes\Erik.cpp(232) : error C2447: missing function header (old-style formal list?)
C:\3dsmax3\Scenes\Erik.cpp(264) : error C2143: syntax error : missing ';' before '}'
C:\3dsmax3\Scenes\Erik.cpp(264) : error C2143: syntax error : missing ';' before '}'
C:\3dsmax3\Scenes\Erik.cpp(264) : error C2143: syntax error : missing ';' before '}'
C:\3dsmax3\Scenes\Erik.cpp(278) : error C2143: syntax error : missing ';' before '{'
C:\3dsmax3\Scenes\Erik.cpp(278) : error C2447: missing function header (old-style formal list?)
C:\3dsmax3\Scenes\Erik.cpp(314) : error C2065: 'sizex' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(315) : error C2065: 'sizey' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(351) : error C2070: illegal sizeof operand
C:\3dsmax3\Scenes\Erik.cpp(358) : error C2065: 'normals' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(358) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(358) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(358) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(358) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(358) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(358) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(358) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\3dsmax3\Scenes\Erik.cpp(358) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\3dsmax3\Scenes\Erik.cpp(358) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\3dsmax3\Scenes\Erik.cpp(359) : error C2065: 'textures' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(359) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(359) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(359) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(359) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(359) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\3dsmax3\Scenes\Erik.cpp(359) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\3dsmax3\Scenes\Erik.cpp(360) : error C2065: 'vertices' : undeclared identifier
C:\3dsmax3\Scenes\Erik.cpp(360) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(360) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(360) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(360) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(360) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(360) : error C2109: subscript requires array or pointer type
C:\3dsmax3\Scenes\Erik.cpp(360) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\3dsmax3\Scenes\Erik.cpp(360) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
C:\3dsmax3\Scenes\Erik.cpp(360) : warning C4244: 'argument' : conversion from 'int' to 'float', possible loss of data
Error executing cl.exe.

Results
Erik.obj - 44 error(s), 8 warning(s)

Warrior
04-22-2001, 12:51 PM
theres nothing there that anyone here can really help you with. theres all sorts of errors there. maybe your not including a .h that you were supposed to? you will just have to go through them and figure them out.

Korval
04-22-2001, 07:43 PM
I'd like to add that the compiler is, basically, saying that the code is seriously broken. If you want us to help you debug it, we will need to see the code.

bobert
04-23-2001, 11:25 AM
my first judjment says that the variables your format code is referring to are not global, or are not passed as parrameters....but thats just me. http://www.opengl.org/discussion_boards/ubb/wink.gif

(is it in a seperate cpp file or just a local function?)

Deiussum
04-23-2001, 12:22 PM
Most of those errors seem to be trying to tell you that you have no clue what you are doing with C/C++. http://www.opengl.org/discussion_boards/ubb/smile.gif

Get a good C/C++ book. Spend a few months reading it, and if you weren't too overwhelmed, then try and come back to OpenGL.

You can post your code here and I'm sure we can find all the mistakes for you, but you probably won't learn anything in the process and will end up posting a long list of stupid compile errors the next time you run into a problem.

I don't mean to sound harsh, but trying to use OpenGL before you understand the language you are using is equivalent to trying to run before you can walk.

unleashed
04-23-2001, 03:49 PM
hehe, i have never seen someone post that reply to a question so much. I am sure it is right in a large number of instances but still makes me laugh.

Deiussum
04-24-2001, 05:06 AM
Heheh, well it's true. A lot of people seem to think that once they learn how to do Hello World, they are ready for the more advanced stuff.

The above compile errors are indicating missing semi-colons, inproperly created arrays, possibly using variables that haven't been declared, and likely a missing header... In other words simple C/C++ stuff.

mango
04-24-2001, 03:09 PM
Erik is using some tool to generate the C++ code so if the code is bad is the tool to blame. The first error seems to be about growing structures this is in many windows headers but still a non ansi hack. The compiler should not complain unless you have the ansi option enabled. Redefinitions is also common in MS code. If VC++ requires type casts does it certainly seems likely that you have some "strict" options enabled.

unleashed
04-24-2001, 08:06 PM
Deiussum:

No kidding, I have had a number of people ask me really, really basic stuff. Things that you need to know to do anything even somewhat advanced. Like arrays and pointers, etc.
But i feel your pain. Still makes me laugh though so keep it up! hehe

Deiussum
04-25-2001, 11:56 AM
As a lot of people use 3d Exploration, I have a hard time believing that it is making some of those mistakes. If 3d Exploration is generating the code, Erik is probably typing it all in by hand and making a lot of typos rather than using copy/paste.

Just a couple of examples in the code that are clearly wrong, and not the effect of any "strict" options...

It complains about PFD, and the next error complains about MAIN_PLANE. This is probably in the code as PFD MAIN_PLANE rather than PFD_MAIN_PLANE.

hdc undeclared identifier, but nothing stating that HDC is unknown, which it would do if this error were caused by not including windows.h. This indicates to me that it is, in fact, never declared in the scope it is being used.
Same goes for pfd, and nPixelFormat;

normals undeclared identifier followed by a whole bunch of subscript requires array errors. Again... normals isn't declared within the scope he is trying to use it.

I don't mind helping people understand simple C/C++ code, just not usually on a board for meant for OpenGL. If you want to send me the code, Erik, I'll take a look at it and try to explain where the errors are.

Psyche
04-25-2001, 04:24 PM
Hehe, I think Erik is just trying to compile the output file from 3d explorator, which as most of you know creates vertex arrays. He probably didn't include any of the necessary header files or declare any of the variables needed to even create a window or device context to begin with.
Erik; First buy a Introductory C++ book so you get an idea on basic topics such as compiling and general program structure. Then get a more advanced one to learn about ADT's, classes, OOP etc. Then buy Programming Windows by Charles Petzold to learn Win32 so you can handle messages and at least be able to create a window. Finally, get on with Opengl. I know its alot, but these steps are neccessary if you want to understand and be good with opengl (Not that I'm saying I'm incredible, we're all still learning http://www.opengl.org/discussion_boards/ubb/smile.gif
Take your time man, you'll be glad you did