Hello all,<br><div class="gmail_quote"><br>I have been struggling with this problem for 2 days and I cannot really find a solution.<br><br>I have a c++ application that I want to cross compile under Fedora 15  to use it with Windows.<br>
<br>The packages that my app depends on are already pre-compiled in :  /usr/i686-mingw32...../ <br>

<br>I am using CMake. It compiles okay and I generate the .exe file without problems.<br><br>When I try to run it under Windows it complains : <br><br>       &quot;The program cant start because boost_filesystem-gcc45-mt-1_46_1.dll ins missing.......&quot;<br>


<br>I have boost 1.47 installed in the windows machine but the libraries have a different suffix (...vc-xx-mt...)<br><br>When I cross compile I do it statically ( I am attaching my toolchain-mingw32 file )<br><br>My question is, why is the exe program looking for the boost dll with exactly the same name as it has in the linux<br>


machine where the cross  compiled exe has been built from?? <br>In my fedora mingw32 lib folder the boost libraries look like this : libboost_filesystem-gcc45-mt-1_46_1.dll·a<br><br>Is there any way to tell cmake to disregard those suffixes while running in Windows?<br>


<br>Is there any way to tell cmake to copy the boost libraries needed for my application into a local folder that will be included<br>inside the the windows installer?? <br><br><br>Also while cross compiling I had gotten this error :<br>


<br><pre><code><span>In</span><span> file included <br>from </span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>functional</span><span>/</span><span>hash</span><span>/</span><span>detail</span><span>/</span><span>hash_float</span><span>.</span><span>hpp</span><span>:</span><span>17</span><span>,</span><span><br>


from </span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>functional</span><span>/</span><span>hash</span><span>/</span><span>hash</span><span>.</span><span>hpp</span><span>:</span><span>15</span><span>,</span><span><br>


from </span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>functional</span><span>/</span><span>hash</span><span>.</span><span>hpp</span><span>:</span><span>6</span><span>,</span><span><br>


from </span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>unordered</span><span>/</span><span>unordered_set</span><span>.</span><span>hpp</span><span>:</span><span>17</span><span>,</span><span><br>


from </span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>unordered_set</span><span>.</span><span>hpp</span><span>:</span><span>16</span><span>,</span><span><br>


from </span><span>/</span><span>mnt</span><span>/</span><span>VirtualBoxShare</span><span>/</span><span>percolator</span><span>/</span><span>src</span><span>/</span><span>ProteinProbEstimatorHelper</span><span>.</span><span>h</span><span>:</span><span>33</span><span>,</span><span><br>


from </span><span>/</span><span>mnt</span><span>/</span><span>VirtualBoxShare</span><span>/</span><span>percolator</span><span>/</span><span>src</span><span>/</span><span>ProteinProbEstimator</span><span>.</span><span>cpp</span><span>:</span><span>28</span><span>:</span><span><br>


<br></span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>cstdint</span><span>.</span><span>hpp</span><span>:</span><span>105</span><span>:</span><span> error</span><span>:</span><span> expected unqualified</span><span>-</span><span>id before </span><span>&#39;unsigned&#39;</span><span><br>


</span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>cstdint</span><span>.</span><span>hpp</span><span>:</span><span>105</span><span>:</span><span> error</span><span>:</span><span> expected </span><span>&#39;;&#39;</span><span> before </span><span>&#39;unsigned&#39;</span><span><br>


</span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>cstdint</span><span>.</span><span>hpp</span><span>:</span><span>105</span><span>:</span><span> error</span><span>:</span><span> declaration does not declare anything<br>


</span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>cstdint</span><span>.</span><span>hpp</span><span>:</span><span>114</span><span>:</span><span> error</span><span>:</span><span> expected unqualified</span><span>-</span><span>id before </span><span>&#39;unsigned&#39;</span><span><br>


</span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>cstdint</span><span>.</span><span>hpp</span><span>:</span><span>114</span><span>:</span><span> error</span><span>:</span><span> expected </span><span>&#39;;&#39;</span><span> before </span><span>&#39;unsigned&#39;</span><span><br>


</span><span>/</span><span>usr</span><span>/</span><span>i686</span><span>-</span><span>pc</span><span>-</span><span>mingw32</span><span>/</span><span>sys</span><span>-</span><span>root</span><span>/</span><span>mingw</span><span>/</span><span>include</span><span>/</span><span>boost</span><span>/</span><span>cstdint</span><span>.</span><span>hpp</span><span>:</span><span>114</span><span>:</span><span> error</span><span>:</span><span> declaration does not declare anything<br>


<font size="4"><br style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,helvetica,sans-serif">It seemed boost defines a typedf in cstdint that is already defined in somewhere else, I would guess it is because the windows flag is activated<br>


even though it is compiling under linux. I fixed it checking it the definition has been made already but this is not a proper solution. <br>Is it maybe that definition in my code or another cross compiled library?<br><br>
Tool chain file :<br><font size="1"><br>SET(CMAKE_SYSTEM_NAME Windows)<br><br># specify the cross compiler<br>find_file(MINGWV NAMES i586-mingw32msvc-gcc i586-mingw32msvc-g++ PATHS<br>                        /usr/bin<br>                        /usr/local/bin)<br>
if(NOT MINGWV)<br>  set(MINGW_PREFIX &quot;/usr/bin/i686-pc-mingw32-&quot;)<br>  SET(Boost_COMPILER &quot;-gcc45&quot;)<br>else(NOT MINGWV)<br>  set(MINGW_PREFIX &quot;/usr/bin/i586-mingw32msvc-&quot;)<br>  SET(Boost_COMPILER &quot;-mgw&quot;)<br>
endif(NOT MINGWV)<br><br># set(CMAKE_CXX_FLAGS_RELEASE &quot;${CMAKE_CXX_FLAGS_RELEASE} -mwindows -mthreads -static-libgcc&quot;)<br># set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS_DEBUG} -mwindows -mthreads -static-libgcc&quot;)<br>
# SET(CMAKE_SHARED_LINKER_FLAGS &quot;-Wl,--no-undefined,--fix-cortex-a8,-lsupc++ -lstdc++ -L${CMAKE_INSTALL_PREFIX}/lib&quot;)<br># SET(CMAKE_MODULE_LINKER_FLAGS &quot;-Wl,--no-undefined,--fix-cortex-a8,-lsupc++ -lstdc++ -L${CMAKE_INSTALL_PREFIX}/lib&quot;)<br>
<br>set(CMAKE_C_COMPILER    ${MINGW_PREFIX}gcc)<br>set(CMAKE_CXX_COMPILER  ${MINGW_PREFIX}g++)<br>set(CMAKE_RC_COMPILER   ${MINGW_PREFIX}windres)<br># set(CMAKE_AR                 ${MINGW_PREFIX}ar)<br>set(CMAKE_RANLIB         ${MINGW_PREFIX}ranlib)<br>
set(CMAKE_LINKER         ${MINGW_PREFIX}ld)<br>set(CMAKE_STRIP         ${MINGW_PREFIX}strip)<br>set(CMAKE_EXECUTABLE_SUFFIX &quot;.exe&quot;)<br><br># Boost Configuration<br>SET(Boost_USE_STATIC_LIBS ON) <br><br># where is the target environment<br>
SET(CMAKE_FIND_ROOT_PATH /usr/i686-pc-mingw32;/usr/i586-mingw32msvc;/usr/i686-pc-mingw32/sys-root/mingw;/usr/i586-mingw32msvc/sys-root/mingw;<br>                          /home/USERNAME/i586-mingw32msvc;/home/USERNAME/i686-pc-mingw32;${CMAKE_PREFIX_PATH};<br>
                          ${PROJECT_SOURCE_DIR}/../libs;${PROJECT_SOURCE_DIR}/libs;${PROJECT_SOURCE_DIR}/../../libs)<br><br># search for programs in the build host directories<br>SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)<br># for libraries and headers in the target directories<br>
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<br>SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)<br><br> Thank you so much</font><br><font color="#888888"><br>Jose<br></font></span></font></span></code></pre><br>
</div><br>