Welcome! Log In Create A New Profile


Windows 7: utils.dll + dataobjects.dll

Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Windows 7: utils.dll + dataobjects.dll
April 25, 2010 01:22PM
Hey, guys!

I'm currently using Windows 7 and there seems to be a problem with my compiled utils.dll and dataobject.dll because of other missing supporting .dll files used in Windows XP. Anyways I know we not suppose to be using Windows 7, but I really don't want to format my PC and install window XP just because of this. If anybody has same and got the libraries working, any help would be appreciated.
avatar Re: Windows 7: utils.dll + dataobjects.dll
April 25, 2010 02:33PM
Try installing Windows XP as a virtual machine. Virtual Box is brilliant for that.
Re: Windows 7: utils.dll + dataobjects.dll
April 25, 2010 06:02PM
Thanks, doing that right now. But would still rather prefer simpler solution. After all "Simplicity is the only true measure of genius" right? Isn't there a way I can just get the right .dll files and put it in a central location and then tell utils.dll to look there instead....

What I also don't get is why it's a problem in the first place. Isn't this whole point behind Qt, that it's suppose to basically make C++ platform independent or at least create the illusion?
Re: Windows 7: utils.dll + dataobjects.dll
April 26, 2010 12:42AM
I am running Windows 7 with no issues when executing the project from Qt. If I try run the exe file in the command prompt I do get missing file references.
Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 01:27AM
I am running Windows 7 and was also having the same problems, plus a missing "mingwm10.dll" file issue.
To solve this I just added my qt\bin folder ( D:\Unisa\2010\COS3114\Apps\Qt\2009.03\qt\bin\ ) to the PATH system variable and that solved my issues.

Hope that helps.

Now I just have to try read the book and do Ass1 buy Friday so I can learn for other exams, joy joy joy!!!!
Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 01:21PM
am also hating the "mingwm10.dll" file issue!!
i hope what u just posted will help

In a long journey, even a matchstick is heavy...
avatar Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 03:06PM
I've noticed that most of the problems in this forum are from a lack of understanding in the overall compilation and execution of your programs. I think the lecturers should seriously devote more time to explaining this since you are all getting very frustrated over something that is essentially a very simple concept but seems to have been glossed over.

When you create a project, you organise your code into a series of files. Some are source files (cpp), some are header files (h). Each source file gets compiled independently of all others and thus, if you have references to classes/functions/etc that are in other source files, you need to make the compiler aware of these by including their declarations that are in the header files.

Once each source has been compiled, it's intemediate code is packaged into object files. The MinGW compiler names these *.o files, the MS compiler names these *.obj files. Object files are not compatible between compilers.

You can then use a linker to create the final output. There are three types of output that you can generate: stand-alone executables, static library files and dynamic (or shared) library files.

A static library is a package of intermediate code. You can imagine it as a collection of precompiled source files all put into one file instead of many object files. They are useful because you don't need to compile them again and again if you want to reuse the same code in multiple projects. You only have to link the code into your current project. MinGW linker creates *.a files while the MS and Borland compilers create *.lib files. Once again, these files are not compatible between linkers.

An executable is the one you're most familiar with. It is created by the linker by taking all the intermediate code in the object files you've compiled, looking for relevant code in any static libraries you've mentioned and then combining them together and turning them into machine code that can run on the operating system.

A dynamic/shared library is also executable code but it cannot run on it's own. You execute it by loading it via a stand-alone executable. The two files then run side-by-side together till either the stand-alone exits, or it unloads the dynamic/shared library. This is very useful because, if you wish to change a portion of code in a dynamic/shared library, you only need to recompile that library and ship it to your customers, you don't need to recompile the entire project. In addition, if you put reusable code in a dynamic/shared library, you don't need to recompile or link it to every project that needs it. Remember that although a static library is not compiled every time you use it, it still needs to be linked into your executable. With a dynamic/shared library, this step is not necessary since the linking step happens when you need it at runtime. The disadvantage is that loading/unloading a dynamic/shared library is relatively slow.

I hope this clears the definitions up, now to your problems.

When you have 3rd party software (eg, Qt or Ezust) that you can reuse and link to your own code, it's usual for the supplier to give you one of two kinds of packages:
1) A set of header files and a static library
2) A set of header files, a static library and a dynamic/shared library. In this case, the static library is very small and only contains predefined code to help you load and unload the dynamic/shared library automatically, otherwise you'd have to code for it manually.
[you'll rarely get the source code files as well unless it's from an open source project]

In either case, you'll very likely not store these files in the same directory as your own project so you need to tell the compiler where your files are. All compilers will have their own way of dealing with this. Qt tries to standardise this by using project files. qmake then creates the necessary Makefiles that are specific to the compiler you're using (see QTDIR/mkspecs for a list of supported compilers).

In Qt, you would specify the location of the header files with the INCLUDEPATH variable, then you use it in your source code by adding a #include <> precompiler directive.

Since the 3rd party code is usually already compiled and packaged into a static library, you need to tell the linker where to find the library and what it's name is otherwise you're going to get "undefined reference" type of errors. You need to specify two things, the path where the library is found, and then also the specific static library to link to. In Qt you put both of these bits of information into the LIBS variable but you mention the library path with the -L switch and the libary name itself with the -l switch. You only need to mention a path once. If you need to link more than one static library but they are in the same path, you would only mention the path once.

LIBS += -L/path/to/libraries -lstaticlib1 -lstaticlib2 -lstaticlib3

Note: Qt tries to help you here. If it knows what compiler you are using, and you forget the file's extension, it will append this to the search list. eg if I'm using ld.exe (MinGW's linker), and I mention -lstaticlib1, then Qt will change this to -lstaticlib1.a. Don't count on this though, rather name the library file completely. See the qmake documentation for more information about this.

If you follow these steps, you should be able to compile and link properly.

The last thing you need to do though is take care of the dynamic/shared libraries. When you compile a program, the entry point function is main(). This is not actually where the execution begins. All compilers add extra management code. This is responsible for setting up the program and initialising the static variables etc. Each compiler not only adds the absolute minimum but some extra helpful functions as well (eg memory management). These are usually packaged into what's commonly called a runtime library. You can specify that this library is statically linked into your executable but by default, it's supplied as a dynamic/shared library. For MinGW, this code is inside the mingwm10.dll file, for MS, this is in the msvcrt70.dll (or something to that effect). These libraries are required for every project you create.

When you have compiled your executable, you need to make sure that the dynamic/shared libraries are visible as well. The common thing, if you create the libraries yourself, is to include them in the same directory that your executable is in. If not, they need to be in one of the search paths so that the operating system can find them. In Windows, this would be the PATH environmental variable, in Linux, this would be the LD_LIBRARY_PATH variable.

The runtime library should already be in the search path. The compiler should have added it upon installation. If you're using MinGW, you should see a directory ending with mingw/lib in the PATH somewhere. Also, most of the Qt dynamic/shared libaries are in the qt/lib directory (or QTLIB/lib if you set up the variable yourself).

For most of your programs, you'll need at least your program executable and the runtime library. For Qt programs, you'll also need:
QtCore4 - the core classes that handle the basic Qt types and the QObject system
QtGui4 - All the basic GUI classes

(Note: There should be two versions of each dynamic/shared library, one for release builds and one for debug builds. The debug versions have 'd' after the version number)

If you want to install your program on another computer, you'll need to package all these files together and transfer them all to the new machine.

Hopefully, you'll find this useful and not too long-winded and that it helps clear up all your problems.
Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 04:02PM
Thanks Rob - valuable info.
Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 06:33PM
Thanks, this is awesome...Think I've actually solved my problems though. Went and searched for a proper explanation of the difference between static and dynamic libraries. But this was a bit more comprehensive and clear. Now hopefully I can do some kick-ass coding!
P.S: They must maybe consider putting this in one of the tut letters for the other people next year. Cause a lot of time has been wasted on this, and I think I speak for most UNISA student...Time is not something we have a lot of.
avatar Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 06:37PM
This is actually something that should be in COS111 or COS112
Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 07:55PM
Yeah true that, and it might have even been...but if it was, my memory is seriously shoddy, cause this is all brand new to me. Still I think they should include it though smile
Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 07:57PM
P.S: Am I the only one that feels the need to put a # in front of the word include every time I use it...lol
avatar Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 09:34PM
Thanks for the explanation, Rob! thumbs up smiley
avatar Re: Windows 7: utils.dll + dataobjects.dll
April 28, 2010 10:43PM
@Marthinus smileys with beer

Only in code, mate, only in code.
Re: Windows 7: utils.dll + dataobjects.dll
April 29, 2010 12:28AM
I must say I have not got this pssd off with a computer program in a very very long time.

Well some how, some way I have managed to get everything working, well I say everything working, I have been trying to get the "reuse" application running as per Tut102.
I just want to check a few things:

a) If I set CONFIG += console in reuse.pro and tick the Run in Terminal box, and also the Release build setting. I can run the app, a console appears and the quotation marks around the items are recognised.
but in Qt Creator Application Output window I get "D:\Unisa\2010\COS3114\src\reuse\release\reuse.exe exited with code 0" which is cool (line 33 in main.cpp -- return 0)
b) I then change the build setting to Debug, it will not run if "Run in Terminal" is checked.
c) Remain in Debug Build setting, but remove "Run in Terminal" and the output is now in the Qt Creator Application Output window BUT the quotation marks around the items are ignored.

I just want to check if these different combinations are all correct??, I have tried others and sometimes get a Window coming up with a "Debugger help Missing" message or something.
Plus it appears the when run through the Terminal Box the item quotation marks are used but if I use the QtC App Output window, they are ignored.

Do these things seem all correct?

I also want to ask if anyone else found that the contents of some files in Tut102 "3.10 Starting off Simple" were slightly different to what they got.
I have a feeling this might be cause I downloaded the Disk from some site rather than getting it from Unisa (unless everyone did it this way, im in the UK so didnt get all the usual Registration things)

Anyways thats my rant for the evening, now that I got QtC running and an application working I can now start on the first Assignment.


(Hopefully when I shut my laptop down, things still work tomorrow)

PS Thanks for the explanation Rob, lights are starting to get brighter.
Re: Windows 7: utils.dll + dataobjects.dll
May 01, 2010 05:54AM
if you guys still have problems with the installation and .dll files and all what not, try th Qt Creator. it works perfectly on windows 7 and you got no issues of having to redirect compilers and all of that
Re: Windows 7: utils.dll + dataobjects.dll
May 01, 2010 09:25AM
When you say Qt Creator do you mean the Qt Creator we have all been talking about? spinning smiley sticking its tongue out
Re: Windows 7: utils.dll + dataobjects.dll
May 01, 2010 09:27AM
I completed the first assignment using QIde which I had set up last year.
I'm just going through the switch to QtCreator and am sorry I didn't do so earlier.

One thing though - does anyone know how to set up command line args in QtCreator?
Re: Windows 7: utils.dll + dataobjects.dll
May 01, 2010 11:36AM
@Andre: Go to project tab after opening desired project and under Run Settings heading look for Running Executable then click on the show details button next to it.
Re: Windows 7: utils.dll + dataobjects.dll
May 01, 2010 02:39PM
Thanks a million - that did the trick.
Re: Windows 7: utils.dll + dataobjects.dll
May 01, 2010 02:42PM
I'm quite enjoying QtCreator.
I used the UI to create a form (dialog) and call some common dialogs - it is almost as friendly as working with VS.
avatar Re: Windows 7: utils.dll + dataobjects.dll
May 01, 2010 06:37PM
Unfortunately you can't use QDesigner for the assignments. You have to generate all forms manually.

If you install the VS add-on, you can open up QDesigner from within VS although it will be in it's own window, unlike in QCreator.
Re: Windows 7: utils.dll + dataobjects.dll
May 03, 2010 02:18PM
Rob - is the inability to not use QDesigner mentioned in the Tutorials?
avatar Re: Windows 7: utils.dll + dataobjects.dll
May 03, 2010 07:56PM
I'm not sure about this year. I'm not registered so I can't see your letters. In previous years, I recall the lecturers mentioning that the widgets must be manually made and that .ui files must not accompany the assignments.

Get hold of the lecturer.
avatar Re: Windows 7: utils.dll + dataobjects.dll
May 16, 2010 10:11PM
Thanks Rob, this is really helpful!
Sorry, only registered users may post in this forum.

Click here to login