hey guys,
im trying to split up my engine into classes with different cpp's then implement them into the main.cpp file. i dont know how to do this, please help:
errors:
Code:Error 1 error LNK2019: unresolved external symbol _glfwSetWindowTitle referenced in function "public: int __thiscall Initialization::initializeWindow(void)" (?initializeWindow@Initialization@@QAEHXZ) C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\initialization.obj Error 2 error LNK2019: unresolved external symbol __imp__glewInit referenced in function "public: int __thiscall Initialization::initializeWindow(void)" (?initializeWindow@Initialization@@QAEHXZ) C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\initialization.obj Error 3 error LNK2019: unresolved external symbol _glfwTerminate referenced in function "public: int __thiscall Initialization::initializeWindow(void)" (?initializeWindow@Initialization@@QAEHXZ) C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\initialization.obj Error 4 error LNK2019: unresolved external symbol _glfwOpenWindow referenced in function "public: int __thiscall Initialization::initializeWindow(void)" (?initializeWindow@Initialization@@QAEHXZ) C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\initialization.obj Error 5 error LNK2019: unresolved external symbol _glfwOpenWindowHint referenced in function "public: int __thiscall Initialization::initializeWindow(void)" (?initializeWindow@Initialization@@QAEHXZ) C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\initialization.obj Error 6 error LNK2019: unresolved external symbol _glfwInit referenced in function "public: int __thiscall Initialization::initializeWindow(void)" (?initializeWindow@Initialization@@QAEHXZ) C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\initialization.obj Error 7 error LNK2019: unresolved external symbol _glfwGetWindowParam referenced in function _main C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\main.obj Error 8 error LNK2019: unresolved external symbol _glfwGetKey referenced in function _main C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\main.obj Error 9 error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function _main C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\main.obj Error 10 error LNK2019: unresolved external symbol _glfwEnable referenced in function _main C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\main.obj Error 11 error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\main.obj Error 12 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\SkylineGame\MSVCRTD.lib(crtexew.obj) Error 13 error LNK1120: 12 unresolved externals C:\Users\adam\documents\visual studio 2010\Projects\SkylineGame\Debug\SkylineGame.exe 1
main.cpp
Code:#include "main.h"#include "initialization.h" int main() { Initialization *Init; Init = new Initialization; Init->initializeWindow(); glClearColor(0.0f, 0.0f, 0.3f, 0.0f); // Ensure we can capture the escape key being pressed below glfwEnable( GLFW_STICKY_KEYS ); do{ // Swap buffers glfwSwapBuffers(); } // Check if the ESC key was pressed or the window was closed while( glfwGetKey( GLFW_KEY_ESC ) != GLFW_PRESS && glfwGetWindowParam( GLFW_OPENED ) ); return 0; }
main.h
Code://INCLUDES#ifndef MAIN_H_ #define MAIN_H_ #include "initialization.h" #include <GL/glew.h> #include <stdio.h> #include <stdlib.h> #include <GL/glfw.h> //math lib #include <glm/glm.hpp> using namespace glm; #endif //POINTERS & DECLARATIONS
initialization.cpp
Code:#include "initialization.h"#include "main.h" int Initialization::initializeWindow() { //Init GLFW if(!glfwInit()) { fprintf(stderr, "could not initiailize GLFW\n"); return -1; } glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4); //4x anti-aliasing glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); //using opengl 3.1 glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 1); glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); //destroying legacy opengl //open a window if (!glfwOpenWindow(1024, 768, 0,0,0,0, 32,0,GLFW_WINDOW)) { fprintf(stderr, "failed to open the window\n"); glfwTerminate(); return -1; } //init GLEW if (glewInit() != GLEW_OK) { fprintf( stderr, "failed to init GLEW\n"); } //window title glfwSetWindowTitle("Skyline Engine (x86)"); return 1; }
initialization.h
Code:#ifndef INITIALIZATION_H_ #define INITIALIZATION_H_ class Initialization { public: int initializeWindow(); int dropWindow(); }; #endif
a user friendly response would be greatly appreciated :P



3Likes
LinkBack URL
About LinkBacks




