PDA

View Full Version : Using libs built in VS2008?



laserbeak43
15th November 2009, 17:12
Hello,
I have built some library files for portaudio using VS 2008 and the msvc compiler so that I could use them with my Qt GUI application in Creator. but my application doesn't start and i don't get any build errors.
When i go straight to the executable's directory and try to launch the .exe, i get the message
and if i try to click the executable it says 'this program cant start because mingwm10.dll is missing from your computer try reinstalling the program to fix this problem.'
But doesn't the installation of Qt take care of this for you? I've not had this problem before.
can someone please help? below is the output when i build my application

Thanks


Running build steps for project SawUI...
Starting: D:/Qt/2009.04/qt/bin/qmake.exe C:/Users/Laserbeak/Documents/SawUI/SawUI.pro -spec win32-g++ -r
Exited with code 0.
Starting: D:/Qt/2009.04/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Users/Laserbeak/Documents/SawUI'
D:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/Laserbeak/Documents/SawUI'
gcc -c -g -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\Qt\2009.04\qt\include\QtCore" -I"d:\Qt\2009.04\qt\include\QtGui" -I"d:\Qt\2009.04\qt\include" -I"d:\source\portaudio\include" -I"d:\source\portaudio\src\os\win" -I"d:\Qt\2009.04\qt\include\ActiveQt" -I"debug" -I"." -I"d:\Qt\2009.04\qt\mkspecs\win32-g++" -o debug\patest_saw.o d:\source\portaudio\test\patest_saw.c
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\SawUI.exe debug/main.o debug/mainwindow.o debug/patest_saw.o debug/moc_mainwindow.o -L"d:\Qt\2009.04\qt\lib" -lmingw32 -lqtmaind D:\source\portaudio\build\msvc\Win32\Debug\portaud io_x86.lib D:\source\portaudio\build\msvc\Win32\Release\porta udio_x86.lib -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/Users/Laserbeak/Documents/SawUI'
mingw32-make: Leaving directory `C:/Users/Laserbeak/Documents/SawUI'
Exited with code 0.

squidge
15th November 2009, 17:47
Qt Creator uses a MinGW environment, so any app compiled in it will need the MinGW DLL. You can copy the dll from the installed Qt directory.

laserbeak43
15th November 2009, 18:47
Qt Creator uses a MinGW environment, so any app compiled in it will need the MinGW DLL. You can copy the dll from the installed Qt directory.

Thanks for that, but it's asking for all kinds of .dlls ones that i've included a path to in my .pro file and even qt ones. shouldn't creator take care of this ?

-edit-
I even put the QtCore4.dll in the directory since it asked for it and it still asks for it.

laserbeak43
15th November 2009, 18:55
ok, it runs when i click run in creator, but asks for QtCore4.dll when i click the actual executable. AND, when it runs, only the portaudio portion runs. The GUI i've with Creator/Designer, doesn't show up.

squidge
15th November 2009, 19:01
Yes, it'll ask for all the DLLs, QtCore4, QtGUI4, etc, all the modules you've asked for, unless those DLLs are in the system PATH.

Secondly, whilst you can use a DLL written in Visual Studio in QtCreator, you can't link to the appropriate .lib file, as GCC and MSVC uses incompatible formats.

Compile the entire thing in MSVC, or in QtCreator, not both.

If you don't want the DLL dependency, then recompile Qt statically, but read the license first.

laserbeak43
15th November 2009, 19:07
Secondly, whilst you can use a DLL written in Visual Studio in QtCreator, you can't link to the appropriate .lib file, as GCC and MSVC uses incompatible formats.

Compile the entire thing in MSVC, or in QtCreator, not both.


I've always wondered that. Thing is, I don't know if i can build these libs with gcc. or at least there's no documentation to do it.

-edit- and if i can't link the third party lib, then why is it that the third party part of the app is the only thing that's working?

squidge
15th November 2009, 22:43
Without seeing exactly how you are building & linking it all together, I couldn't say.

laserbeak43
16th November 2009, 02:17
Without seeing exactly how you are building & linking it all together, I couldn't say.

just built qt again with msvc this time. added my msvc build to creator. ran it and i got what should be a ui, but it doesn't show up for some reason. I'll do my best to make a self contained project and post it in a bit.