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

Steven Truppe steven.truppe at chello.at
Sat Sep 17 21:32:45 EDT 2016


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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160918/85d2670d/attachment.html>


More information about the Scons-users mailing list