Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2003-02-25 13:18:17


Vladimir Prus <ghost_at_[hidden]> writes:

> David Abrahams wrote:
>> Vladimir Prus <ghost_at_[hidden]> writes:
>> > David Abrahams wrote:
>> >> OK, I made some progress with the limited "test_all.py msvc" (no
>> >> version). Now it fails here. I'm a bit stumped now; not quite sure
>> >> what this is supposed to be doing or why it's failing.
>> >
>> > a.obj : error LNK2001: unresolved external symbol "void __cdecl z2(void)"
>> > (?z2@@YAXXZ)
>> > a.obj : error LNK2001: unresolved external symbol "void __cdecl z1(void)"
>> > (?z1@@YAXXZ)
>> > a.obj : error LNK2001: unresolved external symbol "int __cdecl bar(void)"
>> > (?bar@@YAHXZ)
>> > bin\msvc\debug\a.exe : fatal error LNK1120: 3 unresolved externals
>> > Microsoft (R) Incremental Linker Version 6.00.8447
>> >
>> > Considering the first two functions: They are declared in z.cpp depending
>> > on value of the SELECT macros. The idea is that z.cpp should be compiled
>> > two times: once with SELECT equal to 1 and then with SELECT equal to 2.
>> > These compilations should define z1 and z2 respectively.
>> >
>> > The most likely problem is that obj_1 and obj_2 main targets are not
>> > linked to a.exe.
>>
>> That's very true; that is what's (not) happening. But how do we get
>> it to start happening?
>
> Here's a part of builtin.respose-file:
>
> if $(sources[2-])
> {
> response-file-2 $(target) : $(sources[2]) ;
> }
>
> I think you meant $(sources[2-]) in the second case too ;-)

Nice catch. Now we have:

dependency_test : "c:\boost\tools\build\test\..\jam_src\bin.ntx86\bjam -sBOOST_BUILD_PATH=c:\boost\tools\build\test\..\new;c:\boost\tools\build\test -d0 --quiet msvc " returned 1
STDOUT ============
x.cpp
a.cpp
linking "bin\msvc\debug\a.exe" ,
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.

"bin\msvc\debug\x.obj"
"bin\msvc\debug\a.obj"
b.cpp
linking "bin\msvc\debug\b.exe" ,
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.

"bin\msvc\debug\b.obj"
c.cpp
linking "bin\msvc\debug\main-target-c\c.exe" ,
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.

"bin\msvc\debug\main-target-c\c.obj"
y.cpp
linking "bin\msvc\debug\d.dll" "bin\msvc\debug\d.lib" , /INCREMENTAL:NO /IMPLIB:"bin\msvc\debug\d.lib"
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.

"bin\msvc\debug\y.obj"
e.cpp
linking "bin\msvc\debug\main-target-e\e.exe" ,
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.

"bin\msvc\debug\main-target-e\e.obj"
"bin\msvc\debug\d.lib"
LINK : fatal error LNK1181: cannot open input file 'bin\msvc\debug\d.lib'
...failed updating 1 target...

STDERR ============

FAILED
FAILED test of c:\boost\tools\build\test\..\jam_src\bin.ntx86\bjam -sBOOST_BUILD_PATH=c:\boost\tools\build\test\..\new;c:\boost\tools\build\test -d0 --quiet msvc
at line 288 of BoostBuild.py (fail_test)
from line 242 of BoostBuild.py (run_build_system)
from line 8 of dependency_test.py
from line 34 of test_all.py (run_tests)
from line 89 of test_all.py

Compilation exited abnormally with code 1 at Tue Feb 25 13:16:14

The problem here is that y.cpp has nothing in it to export, so the
linker helpfully decides not to create an implib.

BTW, we're going to have to deal with __declspec(dllXXport) somehow if
these tests are going to work on MSVC :-S

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk