Answer the question
In order to leave comments, you need to log in
How to properly create header, implementation files in C++?
Do not judge strictly)
Hello C++ people)
I am learning Python 3 and set myself the task of translating the glut library into Python 3
Here is the header file
#include <glut.h> //подключаем заголовочный файл glut.h
#pragma comment (lib, "glut32.lib") // link with Win32 GLUT lib
namespace pyglut{
class PythonGlut{
public:
PythonGlut();
~PythonGlut();
// Инициализация GLUT и создание окна
void PythonGlutInitDisplayMode(unsigned int mode);
};
}
#include "PythonGlut.hpp" //подключаем заголовочный файл PythonGlut.hpp
namespace pyglut{
PythonGlut::PythonGlut() { }
PythonGlut::~PythonGlut() { }
// Инициализация GLUT и создание окна
void PythonGlut::PythonGlutInitDisplayMode(unsigned int mode){
glutInitDisplayMode(mode);
}
}
#include "PythonGlut.hpp"
using namespace pyglut;
int main(int argc, char **argv) {
//создаем объект типа PythonGlut
PythonGlut pythonglut;
// инициализация
pythonglut.PythonGlutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
return 1;
}
C:\PyScripterProjects\PyGlut>cl glut_window.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
glut_window.cpp
Microsoft (R) Incremental Linker Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:glut_window.exe
glut_window.obj
glut_window.obj : error LNK2019: unresolved external symbol "public: __thiscall
pyglut::PythonGlut::PythonGlut(void)" ([email protected]@@[email protected]) referenced
in function _main
glut_window.obj : error LNK2019: unresolved external symbol "public: __thiscall
pyglut::PythonGlut::~PythonGlut(void)" ([email protected]@@[email protected]) referenced
in function _main
glut_window.obj : error LNK2019: unresolved external symbol "public: void __this
call pyglut::PythonGlut::PythonGlutInitDisplayMode(unsigned int)" (?PythonGlutIn
[email protected]@[email protected]@[email protected]) referenced in function _main
glut_window.exe : fatal error LNK1120: 3 unresolved externals
C:\PyScripterProjects\PyGlut>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question