undeclared-identifier

undeclared identifier - unsure as to why

牧云@^-^@ 提交于 2021-02-05 08:50:08
问题 I am just learning C I have written the following: void main(void) { unsigned int curr_dat = 0; // The current dat file to use unsigned char ch = 0; // Key entered at keyboard unsigned char lastkey = 0; // Last key entered (movement command) FILE *fp; } However i am getting these errors when trying to compile: error C2065: 'FILE' : undeclared identifier error C2065: 'fp' : undeclared identifier warning C4552: '*' : operator has no effect; expected operator with side-effect I'm unsure why as i

use tag to determine the task a slider does if and only if a button is tapped

别来无恙 提交于 2020-03-25 19:19:21
问题 My swift code right now uses a func addBOx to add a series of imageviews to a uiviewcontroller screen. When the user double taps on a single imageview it allows it to change the width of it. When the series of imageviews is on the screen and the user taps the opacity button then if and only if they tap the opacity button then after touch the iamgeview that was added then the slider that was added to changed the width changes the opacity or alpha of the imageview selected. I have added the gif

use tag to determine the task a slider does if and only if a button is tapped

寵の児 提交于 2020-03-25 19:19:11
问题 My swift code right now uses a func addBOx to add a series of imageviews to a uiviewcontroller screen. When the user double taps on a single imageview it allows it to change the width of it. When the series of imageviews is on the screen and the user taps the opacity button then if and only if they tap the opacity button then after touch the iamgeview that was added then the slider that was added to changed the width changes the opacity or alpha of the imageview selected. I have added the gif

C++ beginner's coding mistake: “Undeclared identifier”?

孤者浪人 提交于 2020-01-11 10:06:29
问题 I'm to use C++ for a very small part of my project. I must be coding something wrong, but my knowledge of C++ is what it is and I can't get around this... See both the AbstractContactListener.h and .mm files below. The problem is in isFixtureCollidingWithFixtureOfType(...) method, I can't access the _contact vector. What could I be doing wrong here? header: struct JRContact { b2Fixture *fixtureA; b2Fixture *fixtureB; bool operator==(const JRContact& other) const { return (fixtureA == other

Problems loading resources from function C++/SFML

一世执手 提交于 2020-01-07 07:28:28
问题 I have a stucture that I use to declare Textures, Sprites, Music, Fonts, Sounds, etc in a header. I then use a corresponding .cpp file to set said textures to their corresponding sprites, and so on. I have created the struct object in main, and called the function. But When I build my program, I get a million "undeclared identifier" errors. What am I doing wrong? Here's my code: resources.h: #ifndef __SFML__resources__ #define __SFML__resources__ #include "SFML/Audio.hpp" #include "SFML

C++: 'set' and 'vector' "undeclared despite #include statements

删除回忆录丶 提交于 2019-12-24 16:18:35
问题 I am using Netbeans 7.1 on Ubuntu 11.04. The following call set< Triangle > V; gives the error message error: ‘set’ was not declared in this scope and the following call vector< Triangle > ans; gives the error message error: ‘vector’ was not declared in this scope This despite my having #include <vector> #include <set> #include <map> at the beginning of the C++ file. At help resolving this would be greatly appreciated. Peter. 回答1: you forgot about namespace std : std::set< Triangle > V; std:

(Qt C++) ui Undeclared Identifier When in New Function

為{幸葍}努か 提交于 2019-12-12 04:03:29
问题 :) I am working on a project and I need to take a value (ui->SpawnX->value()) and put it into an int variable. When I put: temp_int = ui->SpawnX->value(); in void MainWindow::on_actionSave_savegame_dat_triggered() { int temp_int; } it runs flawlessly, however, I am going to have a lot of these so I want to put it in a simple function. So, above this I made: void LevelWrite() { int temp_int; temp_int = ui->SpawnX->value(); } But whenever I run it, I get an error saying "ui" : undeclared

Qt c++ GUI call from another class

二次信任 提交于 2019-12-07 19:03:14
问题 I created a button and a textbrowser via gui drag&drop. the ui is created in the mainwindow.cpp as well as the click-button-function. There is a main.cpp but thats irrelevant cause the program shall not start until the startbutton is clicked. #include "mainwindow.h" #include "ui_mainwindow.h" #include "myserver.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_startButton

glutInitContextVersion() is missing from glut library

杀马特。学长 韩版系。学妹 提交于 2019-12-07 06:41:38
问题 I am practicing some opengl code, how ever when i want to force the opengl context to use a certain version of opengl through glutInitContextVersion() it fails compilation process and gives this message:- use of undeclared identifier 'glutInitContextVersion' i want to fix this issue so i kept my code as simple as possible code #include "File.h" #include <GLUT/GLUT.h> #include <OpenGL/OpenGL.h> using namespace std; int main () { glutInitContextVersion(3,2); return 1; } However i was able to

glutInitContextVersion() is missing from glut library

牧云@^-^@ 提交于 2019-12-05 10:57:21
I am practicing some opengl code, how ever when i want to force the opengl context to use a certain version of opengl through glutInitContextVersion() it fails compilation process and gives this message:- use of undeclared identifier 'glutInitContextVersion' i want to fix this issue so i kept my code as simple as possible code #include "File.h" #include <GLUT/GLUT.h> #include <OpenGL/OpenGL.h> using namespace std; int main () { glutInitContextVersion(3,2); return 1; } However i was able to use other glut functions without any error or warning messages I am running Xcode 4.4.1 on Macbook air