Sign in to follow this  
PeLiQ

Project in .NET

Recommended Posts

Sorry this is a stupid Question but i really need help in here, im trying to run a program from NEHE openGL tutorial by copy paste and make new project but why i cannot compile ? while i already copy glut.lib, glaux.lib into .net lib directory and copy gl.h etc into .net include directory, and copy opengl32.dll into system 32. Any suggestion ? maybe some setting Thanks, Felix

Share this post


Link to post
Share on other sites
Did you add the libraries to the project? Also, telling us it doesn't compile isn't very helpful. Give us errors. Are they link errors? compilation errors? etc.

Share this post


Link to post
Share on other sites
in some tutorial if you open the project files using .NET the library didn't show up maybe it because windows based lib (basetsd.h). but it will show up in visuall c++ 6 what im trying to say is, if i run the project then it works but if i copy paste the code and put in new project it can build but cannot compile, some of errors are:

a.obj : error LNK2001: unresolved external symbol _gluPerspective@32
a.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
a.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
a.obj : error LNK2001: unresolved external symbol __imp__glViewport@16

Share this post


Link to post
Share on other sites
Quote:
Original post by PeLiQ
...it can build but cannot compile
[smile]

Compilation is the translation of source code into object or intermediate code. Linking is the relocation of one or more intermediate code entities into a single binary executable (.EXE, .DLL) or another intermediate code entity (static libraries). Building typically refers to the combined process of compiling and linking.

Your first problem is that you are not using .NET, as far as your comments indicate. You are using Visual Studio .NET or Visual C++ .NET, and writing straight C++ code. Consequently, this thread is being moved to General Programming.

Your real problem, though, is that you have failed to specify the static import libraries for OpenGL in your project settings. That or your directories are screwy. So go look in your project settings for any textbox labeled "additional libraries" or something like that and enter opengl32.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
VB.NET Issue with DirectX 7-9 API

Ok VB.NET Converts what used to be a simple call to an Array

(OLD VB CODE
Public Class Vertices
.v() as D3DVertex
Tag as string
End Class
.
.
.
Dim Vertices as new Verices
.
.
[Do code]
.
.
[Drawing Primative]
Device3d.DrawPrimative(PrimativeType, Flags, Vertices.v, lbound(vertices.v), ubound(vertices.v), Endflags)
)

Take note on the DrawPrimative line - Vertices.V...

in VB.NET that API ref to the Array is now a System.IntPtr and requires that the Array be Marshaled I am assuming.

So I create a Marshal var and a IntPtr (Pointer/Handle) Var

Dim aIntPtr as new System.IntPtr
Dim Marshaller as new System.InteropServices.Marshal

Marshaller.SetStrcuturePtr(Vertices.V, aIntPtr, False)

I know you need to allocat memeory and blocks for this so I do. and I replace the drawing primative code with...
...
[Drawing Primative]
Device3d.DrawPrimative(PrimativeType, Flags, aIntPtr, lbound(vertices.v), ubound(vertices.v), Endflags)

When I run the code it gives me an error saying. The Object / Class must be Blittable or Have a layout...

Does anyone A. Know what that means. B. Know if I am doing this correctly. C. Have a better way of doing this in VB.NET?

Any Idea from VB.NET saviors out there?

Share this post


Link to post
Share on other sites
Not from the saviors :), but I do have a couple of comments.

You seem to be making things correctly, but the .net marshaller can't seem to handle marshalling the imported d3dvertex structure(I'm assuming that that comes from the com objects that dx exposes).

I'm not sure what you can do about it - creating your own structure to mirror d3dvertex would probably work, but you'd have to copy arrays and objects left and right, which probably isn't a very good ideia.
If you can (depending on how much code you've already have, for example) You could use the managed dx wrappers from dx9 - but it would mean rewritting any code that deals with directx.

Anyway, could anyone who knows more about using unmanaged directx from vb lend a hand?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this