[Scons-users] Getting builds to work with the -j flag

William Blevins wblevins001 at gmail.com
Thu Feb 18 17:34:44 EST 2016


I agree with Bill. It is related to how you are setting LIBS or some other
linker related environment property, but I don't have a Visual Studio setup
to evaluate directory, so I am having to hypothesize more than I would
like. Thanks for having patience with us :)

On Thu, Feb 18, 2016 at 10:22 PM, Bill Deegan <bill at baddogconsulting.com>
wrote:

> Shouldn't LIBS =['add'] and not LIBS='add'?
>
> On Thu, Feb 18, 2016 at 1:01 PM, William Blevins <wblevins001 at gmail.com>
> wrote:
>
>> Please list what you are expecting to see on the commandline for the call
>> that is failing.
>>
>> Also, see a thought below.
>>
>> On Thu, Feb 18, 2016 at 4:48 PM, Steve Robinson <
>> steven.robinson at motorolasolutions.com> wrote:
>>
>>> Here's the dependency tree.  I don't see anything that jumps out as
>>> wrong to me.
>>>
>>> +-.
>>>   +-add.cpp
>>>   +-add.dll
>>>   | +-add.obj
>>>   | | +-add.cpp
>>>   | | +-add.h
>>>   | | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\cl.EXE
>>>   | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\link.EXE
>>>   +-add.exp
>>>   | +-add.obj
>>>   | | +-add.cpp
>>>   | | +-add.h
>>>   | | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\cl.EXE
>>>   | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\link.EXE
>>>   +-add.h
>>>   +-add.lib
>>>   | +-add.obj
>>>   | | +-add.cpp
>>>   | | +-add.h
>>>   | | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\cl.EXE
>>>   | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\link.EXE
>>>   +-add.obj
>>>   | +-add.cpp
>>>   | +-add.h
>>>   | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\cl.EXE
>>>   +-main.cpp
>>>   +-main.exe
>>>   | +-main.obj
>>>   | | +-main.cpp
>>>   | | +-add.h
>>>   | | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\cl.EXE
>>>   | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\link.EXE
>>>
>>
>> Are you expecting main.exe to be linked into add.dll or add.lib? That
>> dependency does not exist.
>>
>>
>>>   +-main.obj
>>>   | +-main.cpp
>>>   | +-add.h
>>>   | +-C:\Program Files (x86)\Microsoft Visual Studio
>>> 12.0\VC\BIN\amd64\cl.EXE
>>>   +-SConstruct
>>>
>>> On Thu, Feb 18, 2016 at 8:43 AM, William Blevins <wblevins001 at gmail.com>
>>> wrote:
>>>
>>>> Did you look to see if the dependency tree is correct? Try "scons
>>>> --tree=all" for your simple case and give us your output.
>>>> On Feb 18, 2016 4:25 PM, "Steve Robinson" <
>>>> steven.robinson at motorolasolutions.com> wrote:
>>>>
>>>>> Thanks for all the responses!
>>>>>
>>>>>
>>>>> William Blevins: SCons seems to be adding required linker flags.  I
>>>>> figure that it wouldn't even build without the -j flag if that wasn't the
>>>>> case.  I am only building the shared library in this folder.
>>>>>
>>>>>
>>>>> Dominic Binks: I received the following suggestion through a direct
>>>>> email (he couldn't post to the list from his phone):
>>>>>
>>>>> libadd = SharedLibrary('add', 'add.cpp')
>>>>> Program('main', ['main.cpp', libadd])
>>>>>
>>>>> This more explicitly tells the program that it has to build the
>>>>> library before it can build the program.  I like how it reads, but it gives
>>>>> a link error even without -j:
>>>>> link /nologo /OUT:main.exe main.obj add.dll add.lib add.exp
>>>>> add.dll : fatal error LNK1107: invalid or corrupt file: cannot read at
>>>>> 0x2B8
>>>>>
>>>>> Looks like it tries to link the .dll and .exp files instead of just
>>>>> the .lib.
>>>>>
>>>>>
>>>>> Dirk Bächle: When I remove the __declspec, I get this error:
>>>>> LINK : fatal error LNK1181: cannot open input file 'add.lib'
>>>>> The add.lib file never gets created.
>>>>>
>>>>>
>>>>>
>>>>> The unfortunate thing about this example I'm providing is it doesn't
>>>>> get to the heart of the actual problem I'm having which is this error:
>>>>> c1xx : fatal error C1083: Cannot open source file:
>>>>> 'path\to\source\source.cpp': No such file or directory
>>>>>
>>>>> That source file isn't being generated it's just sitting there in the
>>>>> source tree.  Today, I'm going to try to reproduce that problem in a simple
>>>>> example.
>>>>>
>>>>> On Thu, Feb 18, 2016 at 12:11 AM, Dirk Bächle <tshortik at gmx.de> wrote:
>>>>>
>>>>>> Hi Steve,
>>>>>>
>>>>>> On 18.02.2016 00:40, Steve Robinson wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I'm trying to get the -j flag to work in an existing build system to
>>>>>>> speed up build times.  I'm running into errors like this:
>>>>>>>
>>>>>>> c1xx : fatal error C1083: Cannot open source file:
>>>>>>> 'path\to\source\source.cpp': No such file or directory
>>>>>>>
>>>>>>> general error c1010070: Failed to load and parse the manifest. The
>>>>>>> system cannot find the path specified.
>>>>>>>
>>>>>>>
>>>>>> it's been a while since I did development under Windows (MFC stuff
>>>>>> mainly, with VS), but it looks to me as if the DLL declarations (and
>>>>>> possibly additional flags for either creating the DLL, or linking against
>>>>>> it) are they main culprit here:
>>>>>>
>>>>>> Trying to simplify the problem I set up a simple SCons project that
>>>>>>> builds a library and builds a program that links to the library:
>>>>>>>
>>>>>>> ====== add.cpp ======
>>>>>>> #include "add.h"
>>>>>>>
>>>>>>> int addTwoNumbers(int number1, int number2)
>>>>>>> {
>>>>>>> return number1+number2;
>>>>>>> }
>>>>>>> ===================
>>>>>>>
>>>>>>>
>>>>>>> ====== add.h ========
>>>>>>> int __declspec(dllexport) addTwoNumbers(int number1, int number2);
>>>>>>> ===================
>>>>>>>
>>>>>>>
>>>>>> Can you try to run the build without the "__declspec", and without
>>>>>> any additional flags...and then see what happens?
>>>>>>
>>>>>> [...]
>>>>>>> This is just my third month with SCons and it's been really great to
>>>>>>> work with after a few years with CMake.  Hope I can help
>>>>>>> support this community once I get more experience under my belt!
>>>>>>>
>>>>>>>
>>>>>> Thanks for the positive feedback, and we hope we can make you stay! ;)
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Dirk
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Scons-users mailing list
>>>>>> Scons-users at scons.org
>>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__pairlist4.pair.net_mailman_listinfo_scons-2Dusers&d=CwMFaQ&c=q3cDpHe1hF8lXU5EFjNM_A&r=QAOsy4tIVkKeZXD_uUwK1SpaRkBlycQsQnnLO6UQm7gJri9VDujPIuih5pu8f-Ff&m=BEz2_g_-89i0n7q9Lbh9swTmREQNzHIauqxFPTFcn3U&s=YZx-yQ9sUS64HIeIJttLCkoAcdeIHub14XA6RpvMLFM&e=>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Scons-users mailing list
>>>>> Scons-users at scons.org
>>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__pairlist4.pair.net_mailman_listinfo_scons-2Dusers&d=CwMFaQ&c=q3cDpHe1hF8lXU5EFjNM_A&r=QAOsy4tIVkKeZXD_uUwK1SpaRkBlycQsQnnLO6UQm7gJri9VDujPIuih5pu8f-Ff&m=BEz2_g_-89i0n7q9Lbh9swTmREQNzHIauqxFPTFcn3U&s=YZx-yQ9sUS64HIeIJttLCkoAcdeIHub14XA6RpvMLFM&e=>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> Scons-users mailing list
>>>> Scons-users at scons.org
>>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160218/fcfe56fa/attachment.html>


More information about the Scons-users mailing list