Hi

I think I've found an error closely related to: "[1078636] Solution task
doesn't do MFC shared apps"
(http://sourceforge.net/tracker/index.php?func=detail&aid=1078636&group_
id=31650&atid=402868), which has already been closed by driesing and
haniatassi in close collaboration.

To reproduce the error:
Create a standard MFC dialog application [C++] (just the initial dialog
application you get when you create an MFC Dialog project and compile
it).

>From inside Visual Studio I change the 'Character set' property to 'Use
Unicode Character Set' (the default value is 'Use Multi-Byte Character
Set'). This causes '-D _UNICODE' and '-D UNICODE' to be added to the
compiler command line. But it also adds an '/ENTRY:"wWinMainCRTStartup"'
option to the linker command line.

When I compile the thing from Visual Studio it produces a working
application. Nant, however, seems to neglect the character set property,
when it comes to linking.

Here's the verbose output from nant:

--------8<--------8<-------- skipping to first [link]-line...
--------8<--------8<--------

                 [link] PDB file 'C:\Projects\Test\nant2\Debug\
nant2.pdb' does not exist, relinking.
                 [link] Linking 16 files.
                 [link] Contents of C:\temp\tmp1293.tmp.
                 [link] /OUT:"C:\Projects\Test\nant2\Debug\nant2.exe"
                 [link] /DEBUG
                 [link] /PDB:"C:\Projects\Test\nant2\Debug\nant2.pdb"
                 [link] /nologo
                 [link] "kernel32.lib"
                 [link] "user32.lib"
                 [link] "gdi32.lib"
                 [link] "winspool.lib"
                 [link] "comdlg32.lib"
                 [link] "advapi32.lib"
                 [link] "shell32.lib"
                 [link] "ole32.lib"
                 [link] "oleaut32.lib"
                 [link] "uuid.lib"
                 [link] "odbc32.lib"
                 [link] "odbccp32.lib"
                 [link] "C:\Projects\Test\nant2\Debug\nant2.obj"
                 [link] "C:\Projects\Test\nant2\Debug\nant2Dlg.obj"
                 [link] "C:\Projects\Test\nant2\Debug\stdafx.obj"
                 [link] "C:\Projects\Test\nant2\Debug\nant2.res"
                 [link]
                 [link] Starting 'link (@"C:\temp\tmp1293.tmp"
/INCREMENTAL /SUBSYSTEM:WINDOWS /MACHINE:X86)' in
'C:\Projects\Test\nant2'
                 [link] msvcrtd.lib(crtexew.obj) : error LNK2019:
unresolved external symbol [EMAIL PROTECTED] referenced in function
_WinMainCRTStartup
                 [link] C:\Projects\Test\nant2\Debug\nant2.exe: fatal
error LNK1120: 1 unresolved externals

BUILD FAILED

External Program Failed: link (return code was 1120):
NAnt.Core.BuildException: External Program Failed: link (return code was
1120)
   at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask() in
d:\Source\nant-20050721T093848Z\src\NAnt.Core\Tasks\ExternalProgramBase.
cs:line 315
   at NAnt.VisualCpp.Tasks.LinkTask.ExecuteTask() in
d:\Source\nant-20050721T093848Z\src\NAnt.VisualCpp\Tasks\LinkTask.cs:lin
e 314
   at NAnt.Core.Task.Execute() in
d:\Source\nant-20050721T093848Z\src\NAnt.Core\Task.cs:line 171
   at NAnt.VSNet.VcProject.ExecuteInProjectDirectory(Task task) in
d:\Source\nant-20050721T093848Z\src\NAnt.VSNet\VcProject.cs:line 1495
   at NAnt.VSNet.VcProject.RunLinker(String solutionConfiguration) in
d:\Source\nant-20050721T093848Z\src\NAnt.VSNet\VcProject.cs:line 1483
   at NAnt.VSNet.VcProject.Build(String solutionConfiguration) in
d:\Source\nant-20050721T093848Z\src\NAnt.VSNet\VcProject.cs:line 347
   at NAnt.VSNet.ProjectBase.Compile(String solutionConfiguration) in
d:\Source\nant-20050721T093848Z\src\NAnt.VSNet\ProjectBase.cs:line 347
   at NAnt.VSNet.SolutionBase.Compile(String solutionConfiguration) in
d:\Source\nant-20050721T093848Z\src\NAnt.VSNet\SolutionBase.cs:line 265
   at NAnt.VSNet.Tasks.SolutionTask.ExecuteTask() in
d:\Source\nant-20050721T093848Z\src\NAnt.VSNet\Tasks\SolutionTask.cs:lin
e 404
   at NAnt.Core.Task.Execute() in
d:\Source\nant-20050721T093848Z\src\NAnt.Core\Task.cs:line 171
   at NAnt.Core.Target.Execute() in
d:\Source\nant-20050721T093848Z\src\NAnt.Core\Target.cs:line 247
   at NAnt.Core.Project.Execute(String targetName, Boolean
forceDependencies) in
d:\Source\nant-20050721T093848Z\src\NAnt.Core\Project.cs:line 885
   at NAnt.Core.Project.Execute() in
d:\Source\nant-20050721T093848Z\src\NAnt.Core\Project.cs:line 837
   at NAnt.Core.Project.Run() in
d:\Source\nant-20050721T093848Z\src\NAnt.Core\Project.cs:line 922

Total time: 2 seconds.

--------8<--------8<--------8<--------8<--------8<--------8<--------8<--
------8<--------

I think I saw Nant one time also neglected the -D UNICODE option from
the command line

My installation:
NAnt 0.85 (Build 0.85.2031.0; nightly; 24-07-2005)
Microsoft Visual Studio 2003

My minimalistic build file:

<project default="test" basedir=".">
    <target name="clean">
                <delete failonerror="false">
                        <fileset>
                                <include name="Debug/**" />
                                <include name="Release/**" />
                        </fileset>
                </delete>
    </target>
    <target name="test">
        <solution configuration="Debug" solutionfile="Nant2.sln">
        </solution>
    </target>
</project>


Sorry if this is not the right place to report problems such as this.

Best regards
Christian Vind 


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to