[Scons-users] Small troubles while trying simple scons build for my project

Bill Deegan bill at baddogconsulting.com
Sun Sep 18 13:43:18 EDT 2016


After you RTFM..

Here's how to fix it.

And the SConscript file looks like:
Import("env")
env.Library("error", "Error.c")
env.Program("TestError", ["TestError.c"],LIBS=['error'])


On Sat, Sep 17, 2016 at 6:32 PM, Steven Truppe <steven.truppe at chello.at>
wrote:

> Hi everyone, i've a small question and i solved it before but then stuck
> again: here is my file structure:
>
> /bin
> /docs
> /src
> /src/MainApp.c
> /intern
> /intern/Error/Error.h
> /intern/Error/Error.c
> /intern/Error/TestError.c
> /intern/Error/SConscript
> SConstruct
>
> It should be a very simple setup to create my build system for a larger
> project i'm working on.
>
> the SConstruct file looks like this:
> import os
> env = Environment(
>     ENV         =   os.environ,
>     CPPPATH         = "intern/",
> )
> Export("env")
> env.SConscript(r'intern/Error/SConscript', variant_dir=r'#build/Error/',
> duplicate=0)
>
> And the SConscript file looks like:
> Import("env")
> env.Library("error", "Error.c")
> env.Program("TestError", ["TestError.c"])
>
> So far so good, now my problem is that i get this error message when i try
> to compile the TestError.c file:
> gcc -o build/Error/Error.o -c -Ibuild/Error/intern -Iintern/Error/intern
> intern/Error/Error.c
> gcc -o build/Error/TestError.o -c -Ibuild/Error/intern
> -Iintern/Error/intern intern/Error/TestError.c
> gcc -o build/Error/TestError build/Error/TestError.o
> build/Error/TestError.o: In function `main':
> TestError.c:(.text+0x10): undefined reference to `err_hello'
> TestError.c:(.text+0x1a): undefined reference to `err_message'
> collect2: error: ld returned 1 exit status
> scons: *** [build/Error/TestError] Error 1
>
> I had the same issue when used a .cpp file in my project but that's now
> only c so i have no clue... can someone look at the code and help me a
> bit out here, it would would be a great help!
>
> _______________________________________________
> 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/20160918/f7481cdc/attachment.html>


More information about the Scons-users mailing list