Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Intel Composer XE2013 C++ boost 1.51 regex lib not found

elmar_h_
Beginner
702 Views

Hi!

I'm having a small problem with my intel compiler i just downloaded and installed   on my machine using VS2010 SP1 (on Windows 7 & Intel Composer XE2013 ).

as mentioned in the subject the compiler has difficulties in finding the required lib for the regex. i added the additional directories under project properties VC++ directories & under linker -> general -> additional lib. directories. the funny thing is that with the MS visual studio compiler it works, just when i switch to Intel C++ compiler it does not.

is it probably working with an older version of the boost library? which one?

Thks,

Elmar

below the last lines of the output window.

.....

1>          Loaded msvcprtd.lib(MSVCP100D.dll)
1>        Found __NULL_IMPORT_DESCRIPTOR
1>          Referenced in msvcprtd.lib(MSVCP100D.dll)
1>          Loaded msvcprtd.lib(MSVCP100D.dll)
1>        Found MSVCP100D_NULL_THUNK_DATA
1>          Referenced in msvcprtd.lib(MSVCP100D.dll)
1>          Loaded msvcprtd.lib(MSVCP100D.dll)
1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-iw-mt-gd-1_51.lib'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.76
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

0 Kudos
12 Replies
SergeyKostrov
Valued Contributor II
702 Views
>>...LINK : fatal error LNK1104: cannot open file 'libboost_regex-iw-mt-gd-1_51.lib' Any chance that the problem is related to a length of the library name? It is 32 characters plus '\0' at the end and a total length is 33 characters.
0 Kudos
Milind_Kulkarni__Int
New Contributor II
702 Views
Check the difference between project settings when you change the compiler (Intel vs VS). I do not know whether changing just the compiler changes the project settings. I think it does not. what options did you give when trying to build boost with Intel compiler .. did you build both static & dynamic . I think you built with Intel compiler ? according to boost document, "mt-gd" means but using dynamically linked runtime libraries (i.e. msvcrtd.lib instead of libcmtd.lib), also multithreaded with debug symbols. So, possibly, also check either you are using project settings to use dynamic CRT linking (i.e. /MDd instead of /MTd) which causes it to try finding mt-gd version which its unable to find) , so try changing to /MTd (libcmtd) if it works. Or, build Boost using dynamic linking (lengthy process) - mixing those won't work properly. It might be able to do with those /MT or /MD options, and need to do some checking at your end, before this possibility can be ruled out.
0 Kudos
SergeyKostrov
Valued Contributor II
702 Views
>>>>...LINK : fatal error LNK1104: cannot open file 'libboost_regex-iw-mt-gd-1_51.lib' >> >>Any chance that the problem is related to a length of the library name? It is 32 characters plus '\0' at the end and a total >>length is 33 characters. I would also try to pass the library name in a very small test-case, like: // testfindlib.cpp void main( void ) { } using it as a command line argument. Make sure that the library is in the same folder with testfindlib.cpp file.
0 Kudos
SergeyKostrov
Valued Contributor II
702 Views
>>... Is the 32-char limit according to you, system-related or intel compiler related, because i think customer was able to >>build with cl compiler. It's a good question and I think both cases have to be verified. Many software developers are using _MAX_PATH macro, like: char szSomeVariable[ _MAX_PATH ]; or TCHAR szSomeVariable[ _MAX_PATH ]; where _MAX_PATH equals to 260 if MS C++ compiler is used ( I verified with several VSs and a Platform SDK ). Take a look in stdlib.h header file if interested: ... #define _MAX_PATH 260 /* max. length of full pathname */ ... Long names for folders and libraries when combined together could cause a problem.
0 Kudos
Brandon_H_Intel
Employee
702 Views
Have you rebuilt the Boost* libraries with the Intel compiler as well? That's what it's trying to link against - the Intel-compiled Boost library name. I'm thinking it works when you compile with Microsoft because it looks for and finds the differently-named Microsoft-compiled Boost library.
0 Kudos
Milind_Kulkarni__Int
New Contributor II
702 Views
as Brandon suggested, the root cause looks to be missing Boost libraries for the Intel® C++ Compiler. I see 2-solutions. To recompile all required Boost libraries with the Intel® C++ Compiler (libraries with the infix "iw" are created because of this). However, this is not mandatory. The libraries provided for the different Microsoft Visual Studio* versions might be safe to use as well with Intel compiler. In Boost configuration file, "auto_link.hpp", there is # define BOOST_LIB_TOOLSET "iw" , we need to change to reflect corresponding Visual Studio version. There is 1 article for this to try both ways:-- http://software.intel.com/en-us/articles/intel-c-compiler-for-windows-fatal-link-error-lnk1104-when-using-intel-c-compiler-with-boost-libraries it will be good trying the shorter way first.
0 Kudos
SergeyKostrov
Valued Contributor II
702 Views
>>as Brandon suggested, the root cause looks to be missing Boost libraries for the Intel® C++ Compiler. I see 2-solutions. >>To recompile all required Boost libraries with the Intel® C++ Compiler (libraries with the infix "iw" are created because of this). However, >>this is not mandatory. The libraries provided for the different Microsoft Visual Studio* versions might be safe to use as well with Intel compiler. You could try to rename the library for Microsoft C/C++ compiler ( at least for some tests ). But, it is not absolutely safe and I would follow the 1st, that is 'Re-built All', solution.
0 Kudos
elmar_h_
Beginner
702 Views
Thanks everyone for the help. i tried what Milind suggested modifying the auto_link.hpp and it seems to work now. got a runtime error now about a corrupted stack though. any ideas if this is because of mixing the libraries? Run-Time Check Failure #2 - Stack around the variable 'matcher.136810' was corrupted. with matcher being a varialbe from regex. maybe i need to do it the hard way and try to compile boost for the intel compiler.
0 Kudos
SergeyKostrov
Valued Contributor II
702 Views
>>...if this is because of mixing the libraries? >> >>Run-Time Check Failure #2 - Stack around the variable 'matcher.136810' was corrupted. No and it is clear that there is a bug in the source codes. For exampe, an array of 32 'int's is declared on the stack in some function but more than 32 'int's are written. Here is a small example: void SomeFunction( void ) { int iArray[32] = { 0 }; for( int i = 0; i < 40; i++ ) iArray = i; } void main( void ) { SomeFunction(); }
0 Kudos
elmar_h_
Beginner
702 Views
well, i just compiled the Boost library with the intel compiler and it is working nicely. also i tested a boost example file from the boost distribution having similar issues first, but after linking it to the library compiled with intel compiler it also works. maybe there is something going on in the boost distribution source code. thks to everyone!
0 Kudos
Milind_Kulkarni__Int
New Contributor II
702 Views
glad that it worked with intel compiler building boost regex library. another curious thing to try will be running your application/boost example files with stack issues with Visual Studio compiler build, and using the boost built with same VS compiler ? if same issue comes... so, we might be sure if that is mixing libraries issue..
0 Kudos
SergeyKostrov
Valued Contributor II
702 Views
>>...maybe there is something going on in the boost distribution source code. Boost is a very big library and it is hard to tell what else could be wrong without working with it. I think you need to ask some questions on a forum dedicated to Boost applications, etc.
0 Kudos
Reply