Jump to content
  • Advertisement
Sign in to follow this  
svnstrk

migrating to vs

This topic is 2895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi,

i developed my C++ (opengl) code under linux/osx environment now im trying to convert it to vs project. im new to vs environment so i just make a win32 console project, do a few steps to detect my opengl library, but then i got this fancy error:

fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>texture.cpp

what is stdafx.h? where should i place it?

thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
and it also gives me this error:

warning C4627: '#include "Vector3D.h"': skipped when looking for precompiled header use
1> Add directive to 'stdafx.h' or rebuild precompiled header

i got my Vector3D.cpp and .h working fine on the other platform.

Share this post


Link to post
Share on other sites
Why are you using precompiled headers anyway ? Do you need them ?
Try to move the #include "Vector3D.h" line after you #include "stdafx.h".

What I mean is ... always #include "stdafx.h" first ... before any other includes.

Share this post


Link to post
Share on other sites
You have two options here.

The quick fix is to disable precompiled headers for your project. The link Sneftel posted shows how to do that.

The other option is learn about precompiled headers and implement them for your project. They may or may not be useful to you, depending on the size of the project and whether build time is an issue for you. Googling "precompiled headers" should give you all the info you need.

Share this post


Link to post
Share on other sites
hi,

thanks to quick respponse, its working and im moving on. i managed to compile but got this error while linking:

1>main.obj : error LNK2001: unresolved external symbol __imp____glewVertexAttrib1f
1>main.obj : error LNK2001: unresolved external symbol __imp____glewEnableVertexAttribArray
1>main.obj : error LNK2001: unresolved external symbol __imp____glewGetAttribLocation
.
.
.
.
1>main.obj : error LNK2001: unresolved external symbol __imp____glewUseProgram
1>main.obj : error LNK2001: unresolved external symbol __imp____glewTexImage3D

ive followed this tutorial
http://www.fas.harvard.edu/~lib175/pages/visstudio.html

and i got those error. did i miss anything? what does the error says?

Share this post


Link to post
Share on other sites
You need to link a library to your project. Determine what library implements the missing functions, and add that lib using Project->Properties->Linker->Input page.

From the site you mention:
Quote:
In the lib directory (default: C:\Program Files\Microsoft Visual Studio 9.0\VC\lib):
Copy glew32.lib and glew32s.lib into directory
Copy glut32.lib into directory
Copy glew32.dll, glut32.dll into C:\WINDOWS\system (or set up environment path variables if you prefer)

Did you do that?

Also, look at the section "Compiling and Linking with OpenGL Support." Did you link the libraries as shown?

Share this post


Link to post
Share on other sites
hi,

yes i check and recheck, i did put the required file in the right path.
for Project->Properties->Linker->Input page in Additional Dependencies field, i put this value:

glew32.lib opengl32.lib glu32.lib glut32.lib

the opengl works just fine. these errors occurs when i try to link to the glew library. any hint?

thank you

Share this post


Link to post
Share on other sites
Are you doing static linking (vs dynamic linking)? If you are, it may be the glew32s.lib is required, though that doesn't make sense.

Also, if you don't get a "library not found" error, the paths must be correct.

Another possibility is that the functions mentioned in the errors appear in the header files but (for some reason) aren't included in the libs. Do you have up-to-date copies of the libs and dlls?

EDIT: you can check here.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!