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

Steve Robinson steven.robinson at motorolasolutions.com
Wed Feb 17 18:40:51 EST 2016


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.

midl\oleaut32.dll : error MIDL2020 : error generating type library :
SaveAllChanges Failed : .\vc120.tlb (0x80070005)
LINK : fatal error LNK1240: failed to compile IDL content

I don't always have the same problem with the same files, but I can't get
through a complete build without hitting one of these.  When I remove -j #,
there are no errors.


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);
===================


====== main.cpp =====
#include <stdio.h>
#include "add.h"

int main()
{
int number1 = 1;
int number2 = 2;
int answer = addTwoNumbers(number1, number2);
printf("%i + %i = %i", number1, number2, answer);
return 0;
}
===================

====== SConstruct ===
SharedLibrary('add', 'add.cpp')
Program('main', 'main.cpp', LIBS='add')
===================

I place all these files in a directory, open a command prompt, cd to the
directory, and run:
scons -j 2

Usually, but not always, I get an error like this:
LINK : fatal error LNK1181: cannot open in p u tC rfeialtei n'ga
dldi.blriabr'y
 add.lib and object add.exp
scons: *** [main.exe] Error 1181
scons: building terminated because of errors.

So this isn't the same linker error as what I get in the full build system,
but it's a repeatable example of a build that works fine without the -j
flag, but has an error with it.

Anyone have any ideas what's going on?

Here's my environment:
SCons 2.4.1
Windows 7 64-bit
Visual Studio 2013

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!

-Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160217/4e8c4f5f/attachment.html>


More information about the Scons-users mailing list