<br>Yes, <br>you must build *ALL* the components of your application<br>with the exact same compilation mode.<br><br>In this case, you need to compile in Release mode, all the<br>libraries that you are using for your application.<br>
<br><br> Luis<br><br><br>---------------------------------------------------------------------------<br><div class="gmail_quote">On Wed, Sep 9, 2009 at 11:50 AM, motes motes <span dir="ltr"><<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hm I assume its this one:<br>
<br>
<br>
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Components/Optimizers/StandardGradientDescent)<br>
<br>
<br>
from the elastix library. So I assume that I also need to make a<br>
Release build of elastix?<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Wed, Sep 9, 2009 at 5:42 PM, Bill Lorensen<<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br>
> Where is StandardGradientDescent.lib built?<br>
><br>
> On Wed, Sep 9, 2009 at 11:35 AM, motes motes<<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</a>> wrote:<br>
>> Now I have done the above (build itk from VS in Release mode and build<br>
>> my application using the itk Release build in release mode) but<br>
>> instead of:<br>
>><br>
>> Error 12 fatal error LNK1181: cannot open input file 'ITKCommon.lib'<br>
>><br>
>><br>
>> I get a new error:<br>
>><br>
>> Error 12 fatal error LNK1181: cannot open input file<br>
>> 'StandardGradientDescent.lib'<br>
>><br>
>><br>
>> Any ideas?<br>
>><br>
>> And why does these errors suddenly appear when I chose to build a<br>
>> release build instead of Debug build?<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Wed, Sep 9, 2009 at 4:46 PM, Luis Ibanez<<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>> wrote:<br>
>>><br>
>>> Hi Mote,<br>
>>><br>
>>> You need to build in the *SAME* configuration mode,<br>
>>> both ITK *and* your application.<br>
>>><br>
>>> Please do the following:<br>
>>><br>
>>> 1) Load the ITK solution file into Visual Studio.<br>
>>> 2) Select Configuration = Release<br>
>>> 3) Build ITK<br>
>>> (verify that you get an ITKCommon.lib file<br>
>>> in the directory: ITKBINARY/bin/Release)<br>
>>> 4) Load your project solution into Visual Studio<br>
>>> 5) Select Configuration = Release<br>
>>> 6) Build your application<br>
>>><br>
>>><br>
>>> Regards,<br>
>>><br>
>>><br>
>>> Luis<br>
>>><br>
>>><br>
>>> -----------------------------------------------<br>
>>> On Wed, Sep 9, 2009 at 10:41 AM, motes motes <<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</a>> wrote:<br>
>>>><br>
>>>> I am using Visual Studio 2008. I have tried:<br>
>>>><br>
>>>> Build -> Configuration Manager ...<br>
>>>><br>
>>>> And from there chosing "Release". But when I compile I get the error:<br>
>>>><br>
>>>> Error 12 fatal error LNK1181: cannot open input file<br>
>>>> 'ITKCommon.lib'<br>
>>>><br>
>>>> This error does not pop up if I choose the "Debug" configuration<br>
>>>> (default).<br>
>>>><br>
>>>> In a previous post I was told to use cmake to build a release build.<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Wed, Sep 9, 2009 at 4:37 PM, Luis Ibanez<<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>><br>
>>>> wrote:<br>
>>>> ><br>
>>>> > Hi Motes,<br>
>>>> ><br>
>>>> > In Windows you can not select the compilation mode from CMake.<br>
>>>> ><br>
>>>> > You have to do it from inside Visual Studio,<br>
>>>> > after you load the ITK solution file,<br>
>>>> > by selecting the configuration mode.<br>
>>>> ><br>
>>>> > What version of Visual Studio do you use ?<br>
>>>> ><br>
>>>> ><br>
>>>> > Luis<br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > ---------------------------------------------------------------------------------------------<br>
>>>> > On Wed, Sep 9, 2009 at 10:29 AM, motes motes <<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</a>><br>
>>>> > wrote:<br>
>>>> >><br>
>>>> >> Ok but how do I make a release build with cmake?<br>
>>>> >><br>
>>>> >> After chosing "Configure" the only thing related to "Release" is:<br>
>>>> >><br>
>>>> >> CMAKE_CXX_FLAGS_RELEASE /MD /O2 /Ob2 /D NDEBUG<br>
>>>> >><br>
>>>> >> I thought I could check it like "Examples" and "Testing".<br>
>>>> >><br>
>>>> >><br>
>>>> >><br>
>>>> >> On Wed, Sep 9, 2009 at 3:37 PM, John Drescher<<a href="mailto:drescherjm@gmail.com">drescherjm@gmail.com</a>><br>
>>>> >> wrote:<br>
>>>> >> >> In Visual Studio you must select "Release" from the drop down box on<br>
>>>> >> >> the toolbar to perform an optimized compilation. Using a "Release"<br>
>>>> >> >> build can improve performance 10-200%.<br>
>>>> >> >><br>
>>>> >> ><br>
>>>> >> > In my testing with a debug versus release (under visual studio) it is<br>
>>>> >> > much worse than that in debug mode. I mean for a 3D median filter of<br>
>>>> >> > a<br>
>>>> >> > CT volume of 512x512x384. In release mode this completes in less than<br>
>>>> >> > 30 seconds. In debug mode it takes around 30 minutes.<br>
>>>> >> ><br>
>>>> >> > John<br>
>>>> >> ><br>
>>>> >> _____________________________________<br>
>>>> >> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>>> >><br>
>>>> >> Visit other Kitware open-source projects at<br>
>>>> >> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>>> >><br>
>>>> >> Please keep messages on-topic and check the ITK FAQ at:<br>
>>>> >> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>>>> >><br>
>>>> >> Follow this link to subscribe/unsubscribe:<br>
>>>> >> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>>>> ><br>
>>>> ><br>
>>><br>
>>><br>
>> _____________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>><br>
><br>
</div></div></blockquote></div><br>