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

William Blevins wblevins001 at gmail.com
Thu Feb 18 11:43:10 EST 2016


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
>>
>
>
> _______________________________________________
> 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/b9b082f1/attachment-0001.html>


More information about the Scons-users mailing list