Using functionality from another application

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

46 Replies - 2291 Views - Last Post: 14 August 2012 - 05:29 AM Rate Topic: -----

#1 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Using functionality from another application

Posted 05 August 2012 - 05:41 PM

Hello if I am trying to make an object of an application in my application for using its functionality
for example as follows
GLWidget w;


but it says It is in accessible,
Error 1 error C1083: Cannot open include file: 'QGLWidget': No such file or directory
2	IntelliSense: cannot open source file "QGLWidget"	
3       IntelliSense: expected a ';'	
4	IntelliSense: identifier "QTimerEvent" is undefined



Actually an application from QT is integrated into another application of another platform that I am using
i want to use glwidget but its not allowing i don't know if i am missing any linking or something.

Is This A Good Question/Topic? 0
  • +

Replies To: Using functionality from another application

#2 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Using functionality from another application

Posted 05 August 2012 - 06:35 PM

How are you compiling your project? If you used qmake to generate a Makefile that should take care of any linking issues.
Was This Post Helpful? 1
  • +
  • -

#3 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Re: Using functionality from another application

Posted 05 August 2012 - 06:51 PM

View PostGWatt, on 05 August 2012 - 06:35 PM, said:

How are you compiling your project? If you used qmake to generate a Makefile that should take care of any linking issues.


I use visual studio 2010 for compiling my project.

I don't know anything about how to use qmake, and make file in visual studio.

The QT application that is integrated with the my application I think that uses qmake. But I really don't know if I have to compile that application separately or what?

I only know that i am provided with an integrated application with the game engine that i am using and
when i add the headers like GLWidget.h it doesn't give an error but in GlWidget.cpp it has another header named
QGLwidget.h that is shown as it is not added.

and also when I am making an object of GLWidget in my application it gives an error
Was This Post Helpful? 0
  • +
  • -

#4 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Using functionality from another application

Posted 05 August 2012 - 07:13 PM

I didn't realize you were using the VS version. That removes the need for qmake/Makefiles. You probably need to add the QtOpenGL reference to your project. There should be a file called QtOpenGL.lib that you can add to the project's linking phase.
Was This Post Helpful? 1
  • +
  • -

#5 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Re: Using functionality from another application

Posted 05 August 2012 - 07:24 PM

View PostGWatt, on 05 August 2012 - 07:13 PM, said:

I didn't realize you were using the VS version. That removes the need for qmake/Makefiles. You probably need to add the QtOpenGL reference to your project. There should be a file called QtOpenGL.lib that you can add to the project's linking phase.


I tried to add QtOpenGL.lib

Here project->properties->linker->input
in additional libraries. but problem still persists. Do I have to see or get a copy of QtOpenGL.lib also?
Was This Post Helpful? 0
  • +
  • -

#6 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Using functionality from another application

Posted 05 August 2012 - 08:01 PM

Actually, taking a look at that error message it looks like you need to add the QtOpenGL include folder as well.
In my version of VS I can modify the include path from Project>Properties>Config Properties>VC++ Directories
Was This Post Helpful? 1
  • +
  • -

#7 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Re: Using functionality from another application

Posted 05 August 2012 - 08:17 PM

View PostGWatt, on 05 August 2012 - 08:01 PM, said:

Actually, taking a look at that error message it looks like you need to add the QtOpenGL include folder as well.
In my version of VS I can modify the include path from Project>Properties>Config Properties>VC++ Directories


I found the QTGlwidget include folder here

C:\QtSDK\Simulator\Qt\mingw\include\QtOpenGL

which is in the installed files of Qt creator, (I already had installed QtCreator for my purpose but I am using the application of QtCreator that is provided into my game engine)

1. I included this file path where you told me to do it but errors have increased.
2. This folder contains a file named QGLwidget but doesn't contain QGlwidget.h
3. It has another header named qgl.h but not QGLwidget

4. I search in my whole computer but I don't have any QGlwidget.h file anywhere
Was This Post Helpful? 0
  • +
  • -

#8 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Using functionality from another application

Posted 05 August 2012 - 08:29 PM

The QT project doesn't use the .h suffix for the files you should include. What happens if you #include<QGLwidget>?
Was This Post Helpful? 1
  • +
  • -

#9 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Re: Using functionality from another application

Posted 05 August 2012 - 09:45 PM

View PostGWatt, on 05 August 2012 - 08:29 PM, said:

The QT project doesn't use the .h suffix for the files you should include.

Infact, Qt application is integrated in the game engine that i am using but problem is
that it is integrated into one of another applications of the same game engine (for example an editor is provided in the game engine and it is integrated with that editor) and for integrating it with my application in the same game engine code i am trying to access those libraries. QGLwidget etc etc

you are right that Qt applications don't have a suffix of .h but these are integrated with the editor application so that's why it is like that.


Quote

What happens if you #include<QGLwidget>?

if I try to add this file, I cannot add it. It says can not open source file.

This #include<QGLwidget> is added in the GLwidget as it is .

Infact what i do is that I create a folder in the application where i need them to be accessed I copy the GLwidget header, glwidget.cpp and main.cpp into this folder named gl and i add exiting files in the headers and source files from gl folder that I created. Now I add header (GlWidget.h) at the top of myapp.cpp it is added with out any error.
i am not adding QGLwidget anywhere it is only added already in GLwidget.h and at this place it says can not open source file.

It is because i don;t have QGLwidget.h anywhere at my computer i have tried to look at it but couldnt find any where
Was This Post Helpful? 0
  • +
  • -

#10 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Using functionality from another application

Posted 05 August 2012 - 09:48 PM

Are you saying that you don't have a full Qt install? That you only have a handful of files given by the application you're using?
Was This Post Helpful? 1
  • +
  • -

#11 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Re: Using functionality from another application

Posted 05 August 2012 - 10:08 PM

View PostGWatt, on 05 August 2012 - 09:48 PM, said:

Are you saying that you don't have a full Qt install? That you only have a handful of files given by the application you're using?


I have QT installed also, but these files that I am trying to use, these are integrated in one of the applications
provided to me in the SVN of my game engine that I am using. i have a folder of this application named as Horde3D_Qt.
In this folder i have glwidget.cpp , main.cpp, glwidget.h but still here i don't have QGlwidget.h

I copied these 3 files (glwidget.cpp , main.cpp, glwidget.h) from the folder Horde3d_Qt into in my application folder and tried using them from here
Was This Post Helpful? 0
  • +
  • -

#12 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Using functionality from another application

Posted 06 August 2012 - 09:54 AM

Does your project include and link against the standard Qt? You might have to do that.
Was This Post Helpful? 1
  • +
  • -

#13 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Re: Using functionality from another application

Posted 06 August 2012 - 07:24 PM

View PostGWatt, on 06 August 2012 - 09:54 AM, said:

Does your project include and link against the standard Qt? You might have to do that.


I don't think so . What files do i need for linking against standard QT? how can i do that ?
Was This Post Helpful? 0
  • +
  • -

#14 GWatt  Icon User is offline

  • member icon

Reputation: 257
  • View blog
  • Posts: 3,035
  • Joined: 01-December 05

Re: Using functionality from another application

Posted 07 August 2012 - 11:27 AM

You'll have to add the Qt headers to the include path as well as adding the Qt .lib files to the linker. You've already added the QtOpenGL.lib so you'll need to repeat that process for any additional Qt modules. You'll probably only need QtCore, QtGui, and maybe Phonon for sound.
Then you add C:\QtSDK\Simulator\Qt\mingw\include\QtOpenGL, C:\QtSDK\Simulator\Qt\mingw\include\QtCore, C:\QtSDK\Simulator\Qt\mingw\include\QtGui, and whatever else you need to the include path.
This post should detail how to add an include path in VS.
Was This Post Helpful? 1
  • +
  • -

#15 robotics  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 05-August 12

Re: Using functionality from another application

Posted 07 August 2012 - 11:21 PM

View PostGWatt, on 07 August 2012 - 11:27 AM, said:

You'll have to add the Qt headers to the include path as well as adding the Qt .lib files to the linker. You've already added the QtOpenGL.lib so you'll need to repeat that process for any additional Qt modules. You'll probably only need QtCore, QtGui, and maybe Phonon for sound.
Then you add C:\QtSDK\Simulator\Qt\mingw\include\QtOpenGL, C:\QtSDK\Simulator\Qt\mingw\include\QtCore, C:\QtSDK\Simulator\Qt\mingw\include\QtGui, and whatever else you need to the include path.
This post should detail how to add an include path in VS.


I followed you and I added QtOpenGL.lib;QtCore.lib;QtGui.lib;
in here Project->properties->Linker->Input

and it looks now as follows

kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;opengl32.lib;OpenGL32.lib;Horde3D_vc8.lib;Horde3DUtils_vc8.lib;ws2_32.lib;sapi.lib;QtOpenGL.lib;QtCore.lib;QtGui.lib;%(AdditionalDependencies)



and my include Directories look like this

C:\Program Files (x86)\OpenAL 1.1 SDK\include;C:\QtSDK\Simulator\Qt\mingw\include\QtOpenGL;C:\QtSDK\Simulator\Qt\mingw\include\QtGui;C:\QtSDK\Simulator\Qt\mingw\include\QtCore;$(IncludePath)



But I get errors of files

It gives two times this following error

Error 1	error C1083: Cannot open include file: 'QtGui/qwidget.h': No such file or directory



and after this
4 IntelliSense: cannot open source file "QtGui/qpaintengine.h"	
5 IntelliSense: cannot open source file "QtOpenGL/qglcolormap.h"	
6 IntelliSense: cannot open source file "QtCore/qmap.h"	
7 IntelliSense: cannot open source file "QtCore/qscopedpointer.h"	
8 IntelliSense: identifier "QT_BEGIN_HEADER" is undefined
9 IntelliSense: expected a ';'	


and then these are 102 errors, mostly are repeated as of error 9
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »