Community
cancel
Showing results for 
Search instead for 
Did you mean: 
gast128
Beginner
90 Views

TBB on Visual Studio 2003

Hello all,

This isnot a question but more like a tip, which might help since I couldn't find anything about it in the documentation. At home I am still using vstudio 2003 sp1 (a.k.a msvc 7.1). Sources of tbb (version 2.2) includes visual studio projects starting from 2005. In order tobuildit on vstudio 2003, one has to edit the vcproj files (which are basically xml files), with the following edits:

  • 'Version="8,00"' -> 'Version="7,10"'
  • Somehow it also chocked on the x64 configurations. So remove the complete configurations of 'Name="Debug|x64"' and '"Release|x64"' both in the global '' sectionas in the individual file properties section, tagged by ''

Doing this for all the proj files ('tbb.vcproj', 'tbbmalloc.vcproj' and 'tbbmalloc_proxy.vcproj') and one would have a buildable tbb on vstudio 2003. The sln needs to have tag 8.00.

Maybe this helps.

0 Kudos
7 Replies
gast128
Beginner
90 Views

Just donwloaded TBB 3.0 version 5. However with above trick it still wouldn't compile due to a linker error:

tbb_main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static int std::locale::id::_Id_cnt" (__imp_?_Id_cnt@id@locale@std@@2HA).

It turned out that there is a small hack in: 'scheduler_common.h'(41):#define private public. This changes the protection level, but m$ somehow uses the protection level also in its name mangling algorithm for exported data and functions(the symbol present is __imp_?_Id_cnt@id@locale@std@@0HA). Awork aroundcould be to adjust the tbb header file by adding '#include ' before the '#define private ...' in 'scheduler_common.h'.

Maybethis helps too.

slee12345
Beginner
90 Views

Quoting gast128

Hello all,

This isnot a question but more like a tip, which might help since I couldn't find anything about it in the documentation. At home I am still using vstudio 2003 sp1 (a.k.a msvc 7.1). Sources of tbb (version 2.2) includes visual studio projects starting from 2005. In order tobuildit on vstudio 2003, one has to edit the vcproj files (which are basically xml files), with the following edits:

  • 'Version="8,00"' -> 'Version="7,10"'
  • Somehow it also chocked on the x64 configurations. So remove the complete configurations of 'Name="Debug|x64"' and '"Release|x64"' both in the global '' sectionas in the individual file properties section, tagged by ''

Doing this for all the proj files ('tbb.vcproj', 'tbbmalloc.vcproj' and 'tbbmalloc_proxy.vcproj') and one would have a buildable tbb on vstudio 2003. The sln needs to have tag 8.00.

Maybe this helps.

I followed your instructions for building TBB under Studio 2003, but when I build the project I get lots of "assignment operator could not be generated" warnings, and 6 unresolved externals:

Generating Code...
Compiling...
itt_notify_proxy.c
Compiling resources...
Linking...
tbb.def : error LNK2001: unresolved external symbol __TBB_machine_cmpswp8
tbb.def : error LNK2001: unresolved external symbol __TBB_machine_fetchadd8
tbb.def : error LNK2001: unresolved external symbol __TBB_machine_fetchstore8
tbb.def : error LNK2001: unresolved external symbol __TBB_machine_load8
tbb.def : error LNK2001: unresolved external symbol __TBB_machine_store8
tbb.def : error LNK2001: unresolved external symbol __TBB_machine_trylockbyte
C:\SVN\TBB\tbb22_20090809oss\build\vsproject_vs2003\ia32\Debug\tbb_debug.lib : fatal error LNK1120: 6 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file

Did you get these errors, and if so, how did you fix them?

Thanks.
90 Views

It looks you have removed compilation of asm-filesfrom project file.
--Vladimir
SergeyKostrov
Valued Contributor II
90 Views

Take a look at how these functions are declared in 'windows_ia32.h' header file:

...
extern "C" {
__int64 __TBB_EXPORTED_FUNC __TBB_machine_cmpswp8 (volatile void *ptr, __int64 value, __int64 comparand );
__int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchadd8 (volatile void *ptr, __int64 addend );
__int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchstore8 (volatile void *ptr, __int64 value );
void __TBB_EXPORTED_FUNC __TBB_machine_store8 (volatile void *ptr, __int64 value );
__int64 __TBB_EXPORTED_FUNC __TBB_machine_load8 (const volatile void *ptr);
}
...

I wonder if a "some-wrong-value"assigned to'__TBB_EXPORTED_FUNC' macrocaused the problem?

SergeyKostrov
Valued Contributor II
90 Views

It looks you have removed compilation of asm-filesfrom project file.


There are declarations of these functions in 'windows_ia32.h' header file ( as inline-asm ) and in
'atomic_support.asm' file.

SergeyKostrov
Valued Contributor II
90 Views

>>...
>>LINK : fatal error LNK1141: failure during build of exports file
>>...


I would verify all statements '_MSC_VER >= 1300' in TBB headersbecause for MS Visual Studio 2003 '_MSC_VER' is equal to 1300.

Take into account that two TBB headers 'scalable_allocator.h' and 'tbb_assert_impl.h' ( from TBB v4.0! ) have statements:

...
#if _MSC_VER >= 1400
#define __TBB_EXPORTED_FUNC __cdecl
#else
#define __TBB_EXPORTED_FUNC // Not definedfor MS Visual Studio 2003
#endif
...

A value 1400 is for MS Visual Studio 2005.

I'm not sure that it causessome linking problems in your casesbut a verification won't hurt.

Best regards,
Sergey

gast128
Beginner
90 Views

Yes I get this problem too. Look for the 32bit (not the 64 bit) asm files in your solution (i.e. atomic_support.asm, lock_byte.asm) and open its properties. Add

  • command line: ml /c /Cp /coff /Fo"$(OUTDIR)\$(InputName).obj" /Zm /Zi "$(InputPath)"
  • outputs: $(OUTDIR)\$(InputName).obj

Now it should work. Be sure that the asm files are not excluded from build.

Reply