header-files

Undefined base class, though includes present

喜欢而已 提交于 2019-12-12 06:32:13
问题 Forehand I'd like to mention I'm fairly new to C++ programming and that I'm using Ogre3D as framework (for school project reasons). I have a class Player which inherits from the GameObject class. When trying to build the project I'm confronted with the following error: Error C2504 'GameObject' : base class undefined - player.h (9) Which would imply the GameObject class is undefined within the player class' header file. However I have in fact included the GameObject header file in that of the

Getting compilation error for “tlhelp32.h” in MinGW g++ compiler

不想你离开。 提交于 2019-12-12 06:20:14
问题 I am writing a simple C++ app that checks whether a given exe file example:'a.exe' is running or not(windows OS), I have googled and found some code in the below link. http://stackoverflow.com/questions/3355379/how-do-i-find-out-if-a-exe-is-running-in-c The code mentioned above uses a header file "tlhelp32.h". I just copied the code and did some necessary changes then complied it in MinGW , there comes the next problem, all of the datatypes mentioned in that header files are errored out ex:

Class Extension vs Header file [duplicate]

情到浓时终转凉″ 提交于 2019-12-12 04:57:44
问题 This question already has answers here : Objective-C class extension (5 answers) Closed 6 years ago . What exactly are class extensions and header files? What are the differences? What is the difference between declaring a property/method in a header file vs in a class extension. I am completely new to objective-c so beginner terminology would be beneficial :) Thanks in advance! 回答1: As the name suggests, they extend the class. A class continuation is another name. The class extension is

c++ Xcode expected '(' for function-style cast or type construction

不想你离开。 提交于 2019-12-12 04:49:33
问题 I'm trying to compile this cpp and h files but it keeps giving me this error "expected '(' for function-style cast or type construction" and it points to the constructor GasTank::GasTank(double a){ capacity=a; } Any thoughts why? I can't figure it out why it is giving me that error. Here is the rest of the code: // // Header.h // labs // // Created by Pxndroid on 10/17/14. // Copyright (c) 2014 Pxndroid. All rights reserved. // #include<string> using namespace std; class GasTank { private:

Undefined reference to '_*' linker error

跟風遠走 提交于 2019-12-12 03:54:07
问题 I am having trouble compiling/linking the following C code. The linker throws errors that look like the following: pso.o:pso.c:(.text+0x41): undefined reference to '_ps' ... pso.o:pso.c:(.text+0x93): more undefined references to '_ps' follow This is my first time writing C code for gcc, so I'm unsure how to fix this problem. I am assuming that because struct PS is defined my header file, it is somehow not linked to pso.c. However, I did use a #include "ps.h" statement at the top of that

XCode include system file instead of local file

醉酒当歌 提交于 2019-12-12 03:07:39
问题 I am working on an iOS project and include ifaddrs.h in one of my files using #include <ifaddrs.h> Recently, my code stopped working (in particular, getifaddrs ) and I noticed that BLWebSocketsServer delivers a getifaddrs.h/.c which seems to cause issues. If I remove those two files from XCodes "Headers" and "Compile Sources" phase, my code starts working again. Now, for my questions: Why does this happen? getifaddrs.h is not <ifaddrs.h> , so this shouldn'at affect my code, should it? Is

QT/C++ yet another issue about accessing UI files

徘徊边缘 提交于 2019-12-12 02:53:38
问题 Although I have read the answers to this question QT/C++ - Accessing MainWindow UI from a different class and searched the whole www for quite some time - I don't get it working. I was given the task to recreate an applications UI using QT Designer. Unfortunately there was already some UI spread all over several classes (the team then came across the idea, that using QT but not using the Designer however "handcoding" the UI seems to make little sense) So now my job is to untangle the open

Classes from C++ Primer going into Cyclic Dependency

一曲冷凌霜 提交于 2019-12-12 00:27:05
问题 I am following the book - C++ Primer for learning C++. I'm in middle of the chapter introducing classes, and I'm stuck in resolving the header files include of two classes taken as example there. Here are the two classes, and the header files: ScreenCls.h: #ifndef SCREENCLS_H #define SCREENCLS_H #include <iostream> #include "WindowManager.h" using namespace std; class ScreenCls { friend void WindowManager::clear(ScreenIndex); public: typedef string::size_type pos; ScreenCls() { } ScreenCls

Do I need to explicitly include a common header file(in an include path folder) used in shared library?

半腔热情 提交于 2019-12-11 21:07:17
问题 I am using a shared library , say, shr.so . This has some header file, say, shr_struct.h with structures I need to use in my program , say, main_prog.c . Do I need to keep a copy of shr_struct.h in my include path so that I can declare objects of structure types in shr_struct.h in main_prog.c ? 回答1: If your main_prog.c depends on shr_struct.h , the compiler will need to know where this last file is located. Now if the library is installed in the system "standard" library path, you may not

Change String value to uppercase in a C++ header file?

♀尐吖头ヾ 提交于 2019-12-11 20:21:26
问题 I'm trying to convert a String to uppercase in my header file function. However, when I try to do this I get an error saying "Cannot convert from 'class String' to 'char'. Here's my code - #ifndef PATIENT_DEMO_CLASS #define PATIENT_DEMO_CLASS // system defined preprocessor statement for cin/cout operations #include <iostream.h> // header file from book #include "tstring.h" #include <algorithm> #include <string> class PatientDemographicInformation { private: // patient's state String