[SOLVED] TBB, MingW and QtCreator in Windows 7

[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:

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

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:

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

Here's the project pro file:

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

Why isn't the linking working with QtCreator?.

Cheers!.

Cheers!
21 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hi,

what is the target? Is is mingw?

--Vladimir

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!.

Cheers!

Ok, I have checked in the Projects folder in QtCreator and here're the build steps it has by default:


qmake.exe prueba_tbb.pro -r -spec win32-g++ "CONFIG+=declarative_debug

mingw32-make.exe in E:PRUEBAStbbprueba_tbb-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW_

Cheers!

>>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?

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!.

Cheers!

>>..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?

Quote:

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

Cheers!

>>...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.

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

Cheers!

I'll check where to look for version information on Windows 7.

>>...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.

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:


Type: Application extension.

Size: 2,17 MB

Modified date: 07/12/2012 10:37

PS: Sorry for being such a bother...

Cheers!

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 )?

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?.

Cheers!

>>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.

Hi,
Quote:

Congratulations!

Thanks to you!.

Quote:

I think this is how a make file you used was created
It's the one that came with the tgz.

Quote:

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:
< Configuration Name="Debug|x64" OutputDirectory="$(SolutionDir)intel64$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)intel64$(ConfigurationName)" ConfigurationType="2" CharacterSet="0" >

It seems that when you don't define the arch, it defaults to that name. Am I right? o.o

Quote:

Yes, of course.

Where can I do that?. I dont' find any button/link to mark the question as solved.

Cheers!

Quote:

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

Quote:


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!.

Cheers!

>>...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'

Right. Didn't think about that.

Cheers!

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi