Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Adri_C__S_
Beginner
211 Views

[SOLVED] TBB, MingW and QtCreator in Windows 7

Hello!

I have compiled TBB 4.1 from source in Windows 7 using the MingW compiler. I got both the debug and release libs: tbb_debug.dll and tbb.dll.

I have also this trivial code to test the installation:

[cpp]#include "tbb/task_scheduler_init.h"
#include <iostream>
int main(void) {
tbb::task_scheduler_init init;
std::cout << "Ok" << std::endl;
return 0;
}[/cpp]


Compiling the code from the Windows terminal with g++.exe -I%TBB_INCLUDE% -L%TBB_DEBUG_LIB% -l tbb_debug.dll
and executing it goes perfectly.

However, if I try to do the same from QtCreator the compilation is stopped with this error message:

[plain]E:/LIBRERIAS/tbb-4.1_src/build/windows_intel64_gcc_mingw4.5.4_debug/tbb_debug.dll: file not recognized:

File format not recognizedcollect2: ld returned 1 exit status[/plain]

Here's the project pro file:

[plain]TEMPLATE=app

CONFIG+=console

CONFIG-=qt

SOURCES+=main.cpp

#QMAKE_CXXFLAGS+=-fopenmp

#QMAKE_LFLAGS+=-fopenmp

INCLUDEPATH+="E:/SITEGI/LIBRERIAS/tbb-4.1_src/include"

LIBS+=-L"E:/SITEGI/LIBRERIAS/tbb-4.1_src/build/windows_intel64_gcc_mingw4.5.4_debug"-ltbb_debug[/plain]

Why isn't the linking working with QtCreator?.

Cheers!.

0 Kudos
20 Replies
199 Views

Hi, what is the target? Is is mingw? --Vladimir
Adri_C__S_
Beginner
199 Views

Hi! Yes, it is mingw32-make.exe. Also, I have added into my session PATH var the paths to both the debug and release library directories. Cheers!.
Adri_C__S_
Beginner
199 Views

Ok, I have checked in the Projects folder in QtCreator and here're the build steps it has by default: [plain] qmake.exe prueba_tbb.pro -r -spec win32-g++ "CONFIG+=declarative_debug mingw32-make.exe in E:\PRUEBAS\tbb\prueba_tbb-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW_ [/plain]
SergeyKostrov
Valued Contributor II
199 Views

>>I have compiled TBB 4.1 from source in Windows 7 using the MingW compiler... >>... >>However, if I try to do the same from QtCreator the compilation is stopped with this error message... >>... >>...intel64_gcc_mingw4.5.4_debug/tbb_debug.dll: file not recognized >>... Are you compiling 32-bit versions of TBB in both cases?
Adri_C__S_
Beginner
199 Views

Hi!. Sorry for the late reply. Well, it seems that it was only compiling for 64 bit arch. I tried to compile the 32 bit library, with mingw32-make.exe compiler=gcc arch=ia32 and ended getting a new error: ld.exe: cannot find -lmsvcrt. I have checked and that dll is present in C:\Windows\System32. Sorry to bother you!. And thanks!.
SergeyKostrov
Valued Contributor II
199 Views

>>..build/windows_intel64_gcc_mingw4.5.4_debug/tbb_debug.dll: file not recognized: >> File format not recognized collect: ld returned 1 exit status It looks like a verification for a 64-bit format is done and it fails because 'tbb_debug.dll' is compiled for 32-bit platforms. Could you look at 'tbb_debug.dll' properties ( 'Version' property page ) in the Windows Explorer? Where did it come from?
Adri_C__S_
Beginner
199 Views

Could you look at 'tbb_debug.dll' properties ( 'Version' property page ) in the Windows Explorer? Where did it come from?
I'm not used to work in Windows... Do you mean right-clicking on the dll, "properties" and then into "previous versions"???. 0.0
SergeyKostrov
Valued Contributor II
199 Views

>>...I'm not used to work in Windows... Do you mean right-clicking on the dll, "properties"... Yes and you should see a 'Version' property page in the dialog box.
Adri_C__S_
Beginner
199 Views

Ok. I have checked the "previous versions" tab and it's empty. Other tabs that also appear are, in order: General,Security and Details.
SergeyKostrov
Valued Contributor II
199 Views

I'll check where to look for version information on Windows 7.
SergeyKostrov
Valued Contributor II
199 Views

>>...I have checked the "previous versions" tab and it's empty. Other tabs that also appear are, in order: General, Security and >>Details... For a version of some module ( exe, dll, etc ) and additional information ( build number, date of release, platform ) you should look at 'Details' property page.
Adri_C__S_
Beginner
199 Views

Hello!! Most of the fields in the 'Details' property page are empty, like 'File version' or 'Product Name'. Here are the fields that contain any value: [plain] Type: Application extension. Size: 2,17 MB Modified date: 07/12/2012 10:37 [/plain] PS: Sorry for being such a bother...
SergeyKostrov
Valued Contributor II
199 Views

On Windows TBB library could be compiled for two platforms ( take a look at *.vcproj files ): ... Platform Name="Win32" Platform Name="x64" ... You need to understand origins of 'tbb_debug.dll' when compiling for a 64-bit platform. That is, is it from a '..\Debug' folder ( for all 32-bit modules ) or from '..\x64\Debug' folder ( for all 64-bit modules )?
Adri_C__S_
Beginner
199 Views

Oh!!. With the platform names you posted I could compile the 32 bit versions of the library!!!. Just a question, if the 64 but version name is x64, why when I typed "make compiler=gcc" it defaulted to intel64?. I'm curious, since both of them work well. Thanks!. PS: Can I mark this post as solved?.
SergeyKostrov
Valued Contributor II
199 Views

>>With the platform names you posted I could compile the 32 bit versions of the library!!!. Congratulations! >>Just a question, if the 64 but version name is x64, why when I typed "make compiler=gcc" it defaulted to intel64?. I'm curious, since >>both of them work well. I think this is how a make file you used was created and it looks like as undocumented feature, or a bug (?). >>Thanks!. >> >>PS: Can I mark this post as solved?. Yes, of course.
Adri_C__S_
Beginner
199 Views

Hi,
Congratulations!
Thanks to you!.
I think this is how a make file you used was created
It's the one that came with the tgz.
and it looks like as undocumented feature, or a bug (?
I think it's an undocumented feature. Looking at the 'vproj' file I found several lines like this: [plain]< Configuration Name="Debug|x64" OutputDirectory="$(SolutionDir)intel64\$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)intel64\$(ConfigurationName)" ConfigurationType="2" CharacterSet="0" >[/plain] It seems that when you don't define the arch, it defaults to that name. Am I right? o.o
Yes, of course.
Where can I do that?. I dont' find any button/link to mark the question as solved.
199 Views

Adri C. S. wrote:
Just a question, if the 64 but version name is x64, why when I typed "make compiler=gcc" it defaulted to intel64?. I'm curious, since both of them work well.
In case you do not provide "arch" argument there is a runtime detection. It looks that by default gcc build the sample for intel64 arch. x64 is the value that is used in visual studio configurations de facto. We do not want to invent a wheel there. But makefiles use intel64 for 64 bit configurations. --Vladimir

Adri_C__S_
Beginner
199 Views

In case you do not provide "arch" argument there is a runtime detection. It looks that by default gcc build the sample for intel64 arch. x64 is the value that is used in visual studio configurations de facto. We do not want to invent a wheel there. But makefiles use intel64 for 64 bit configurations.
Didn't know that. Thanks!.
SergeyKostrov
Valued Contributor II
199 Views

>>...Where can I do that?. I dont' find any button/link to mark the question as solved... You could edit the title of the thread from: 'TBB, MingW and QtCreator in Windows 7' to '[SOLVED] TBB, MingW and QtCreator in Windows 7'
Adri_C__S_
Beginner
44 Views

Right. Didn't think about that.
Reply