`
tinggo
  • 浏览: 43741 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Compiling OpenGL Programs Using Visual Studio on Lab Windows Machines

阅读更多

Reference URL: (http://www.cs.uiowa.edu/~cwyman/classes/common/howto/compileVS.html)

Compiling OpenGL Programs Using Visual Studio on Lab Windows Machines (e.g., MLH 301):

The hardest part about compiling any program using Visual Studio is figuring out how to navigate the myriad of options. Once you figure out what is important for your project and what you should leave as default, everything is easy.

Remember, the key things you need to do are:

  • Tell Visual Studio where your code resides (or will reside).
  • Tell Visual Studio which code files to compile.
  • Tell Visual Studio what libraries you need.
  • Tell Visual Studio where to find those libraries.

The instructions below will get you through the initial step of setting up a project. Even if you have used Visual Studio before for other classes, I encourage you to read all the steps, as some selections will differ from those needed in prior courses.

These instructions work for Visual Studio 2008, though they are mostly similar for other versions:

  1. Open Visual Studio 2008.
    • If this is your first time, I encourage you to select "Visual C++" as the default configuration.
  2. Once it has completely opened (which may take some time) select from the menu "File" followed by "New" followed by "Project".
  3. In the New Project dialog box:
    • Type a name for your project and a location where you want your project directory.
    • For the project type, select "Visual C++" then "Win32" then "Win32 Console Application"
    • Click "Ok"
  4. In the Win32 Application Wizard dialog box:
    • Click "Application Settings"
    • De-select "precompiled header" (unless you know what they are)
    • Select "empty project"
    • Keep the application type as "Console application"
    • Click "Finish"
  5. You will now return to the main Visual Studio window, where a subwindow entitled "Solution Explorer" will appear. This contains information about "Solution < myTestProject >" (where < myTestProject > is whatever you named your project). Visual Studio should also have created a project directory where it will store the files. Open up the directory "< myTestProject >" and its subdirectory (also called "< myTestProject >"). There you should see a file called < myTestProject >.vcproj (or labeled "VC++ Project"). Copy any code you would like to use into this subdirectory. If there are a lot of files, you may wish to arrange them in an organized fashion.
  6. Back in the Visual Studio subwindow (the "Solution Explorer"), you should see folders labeled "Header Files" and "Source Files."
    • Right click on "Source Files," select "Add," select "Existing File" and then select the C/C++ file you wish to use (e.g., my "glut_template.c" file). Alternately, create a new file and start typing in code from scratch.
    • Right click on "Header Files," select "Add," select "Existing File" and then select the header file you wish to use (e.g., my "glut_template.h" file).
    • If you find it easier, you can drag and drop files directly onto the solution explorer.
  7. Right click on the BOLD name of your project in the "Solution Explorer."
    • Select "Properties" (all the way at the bottom of the pop-up menu)
    • Click the plus (+) next to "Linker" to see more linker options
      • Click on "Input" and add an entry to "Additional Dependencies." This entry should be "opengl32.lib glu32.lib glut32.lib" (without the quotes).
    • Click "OK" to confirm your changes and close the properties dialog.
  8. Double click on any of the listed code files to open them and begin editing.
  9. Once you have finised coding, press "F7" to compile (or build) your project.
  10. Your executable will be in the "Debug" subdirectory of the project's directory. If your executable requires no command-line parameters, you can run it directly from inside Visual Studio by pressing "F5."

If you change the project from a "Debug" to a "Release" build (which I would not recommend during this class), you may need to repeat your changes to the solution's properties page as the Debug and Release builds (by default) have separate properties.

 

分享到:
评论

相关推荐

    DriverStudio 3.2 For VisualStudio 2005 补丁

    DriverStudio 3.2 For VisualStudio 2005 补丁 &lt;br&gt;解决DriverStudio 3.2插件在VisualStudio 2005中无法使用的问题。 &lt;br&gt;原文件说明: &lt;br&gt;Compuware DriverStudio – DriverSuite Version 3.2 &lt;br&gt;...

    OpenGL ES 3.0 Programming Guide, 2nd Edition

    All code has been built and tested on iOS 7, Android 4.3, Windows (OpenGL ES 3.0 Emulation), and Ubuntu Linux, and the authors demonstrate how to build OpenGL ES code for each platform. Coverage ...

    OpenGL ES 2.0 Programming Guide

    OpenGL ES 2.0 is the industry's leading software interface and graphics library for rendering sophisticated 3D graphics on handheld and embedded devices. With OpenGL ES 2.0, the full programmability ...

    build-libboost-windows:用于下载和构建 libboost 的批处理脚本(使用 Visual Studio 编译器)

    用于下载和构建 libboost 的批处理脚本(使用 Visual Studio 编译器) Please keep in mind compiling Boost library takes a very long time.用法: 克隆或下载此 repo 打开命令提示符并 cd 到xxx/build-libboost-...

    Windows XP compiling video (Reupload).mp4

    Windows XP compiling video (Reupload).mp4

    VisualC+++6.0+通用补丁

    虽然微软公司推出了 Visual C++.NET(Visual C++7.0),但它的应用有很大的局限性,只适用于Windows 2000、Windows XP和Windows NT4.0。所以实际中,更多的是以Visual C++6.0为平台。 Visual C++ 6.0 完整绿色通用补丁...

    SDL2.08源码

    Windows with Visual Studio: * Read VisualC.html Windows with gcc, either native or cross-compiling: * Read the FAQ at https://wiki.libsdl.org/moin.fcg/FAQWindows * Run './configure; make; make ...

    Advanced C and C++ Compiling

    Advanced C and C++ Compiling

    Inline Function Expansion for Compiling C Programs - 1989 (p246-chang)-计算机科学

    Inline Function Expansion for Compiling C ProgramsWen-mei W. Hwu and Pohua P. ChangCoordinated Science Laboratory University of Illinois1101 W. Springfield Ave. Urbana, IL 61801 (217) 244-8270hwu@...

    Code Edit Studio v1.1(最新版) 支持超过40种开发语言的超级代码

    Code Edit Studio helps the programmer in many ways., prevents errors, helps in compiling and executing code with ease. Code Edit Studio is professionally designed to meet Microsoft Windows interface ...

    Raspberry.Pi.GPU.Audio.Video.Programming

    Chapter 3: Compiling Programs for the Raspberry Pi Chapter 4: Dispmanx on the Raspberry Pi Chapter 5: EGL on the Raspberry Pi Chapter 6: OpenGL ES on the Raspberry Pi Chapter 7: OpenMAX on the ...

    Programming with Microsoft Visual Basic.NET_Delivery Guide.pdf

    Demonstration: Using the Visual Studio .NET IDE........................................29 Debugging Applications.............................................................................30 ...

    poppler-0.68.0_x86.7z

    So after years of pain, I jumped on oDesk and contracted Ilya Kitaev, to both compile with Microsoft Visual Studio, and also prepare automated tools for easy compiling in the future. Update: MSVC isn...

    Visual+C+++6.0软件下载

    4、系统默认安装在:C:\Program Files\Microsoft Visual Studio 。 5、VC6.0通用补丁:特别适合于解决错误信息:“Compiling... , Error spawning cl.exe” 使用方法:退出VC,运行此文件,单击"是",再启动VC,...

    OpenGL Shading Language, Second Edition

    Linking and Using Shaders Section 7.5. Cleaning Up Section 7.6. Query Functions Section 7.7. Specifying Vertex Attributes Section 7.8. Specifying Uniform Variables Section 7.9. Samplers Section 7.10....

    MySQL V5.5帮助文档

    2.3.5. Installing MySQL on Microsoft Windows Using a noinstall Zip Archive 2.3.6. Troubleshooting a MySQL Installation Under Windows 2.3.7. Upgrading MySQL on Windows 2.3.8. Windows Postinstallation ...

    DriverStudio 3.2 升级补丁

    DriverStudio 3.2 升级补丁 &lt;br&gt;将DriverStudio 3.2升级至DriverStudio 3.2.1 &lt;br&gt;原说明如下: &lt;br&gt;Compuware DriverStudio – DriverSuite Version 3.2 ONLY &lt;br&gt;Version 3.2 patch. The ...

    netbeans-8.0-cpp-windows.exe

    NetBeans IDE is an integrated development environment (IDE) for writing, compiling, testing, and debugging software applications for the JavaTM platform and other environments. NetBeans IDE includes a...

    DLib (Debug_X64)

    Compiling C++ Example Programs on Any Operating System Using CMake

Global site tag (gtag.js) - Google Analytics