build - C++, error while linking. Building with scons -
i try run build example wt project scons, few hours i'm stuck. when compile command:
g++ -o hello hello.cc -i/usr/local/include -l/usr/local/lib   -lwthttp -lwt -lboost_random -lboost_regex   -lboost_signals -lboost_system -lboost_thread -lboost_filesystem   -lboost_program_options -lboost_date_time   (link tutorial: http://www.webtoolkit.eu/wt/doc/tutorial/wt.html#_hangman) ok, , can run simple example. scons file:
env = environment()  #       add header search path env.append(cpppath = ['/usr/include', '/usr/local/include'])  #       add compile-time flags env.append(ccflags=[ #'-wall','-g', '-lwt', '-lwthttp', '-lboost_random', '-lboost_regex', '-lboost_signals', '-lboost_system', '-lboost_thread', '-lboost_filesystem', '-lboost_program_options', '-lboost_date_time' ])  #       add library search path env.append(libpath = ['/usr/lib','/usr/local/lib', '/opt/lib'])  env.program('hello',['exa.cc'])  #program('exa.cc') ~                                           i can't , following errors: http://pastebin.com/ft2b62ie . answer.
lukasz.
the following sconstruct should work you: difference place libraries in libs scons construction variable , remove '-l' each, since not necessary in scons.
(notice same answer user2093113, libraries correctly specified: https://stackoverflow.com/a/16555400/1158895)
env = environment()  #       add header search path env.append(cpppath = ['/usr/include', '/usr/local/include'])  #       add compile-time flags #env.append(ccflags=['-wall','-g'])  # libraries link against # notice dont need '-l', since scons platform independent env.append(libs=[   'wt', 'wthttp',   'boost_random', 'boost_regex', 'boost_signals',   'boost_system', 'boost_thread', 'boost_filesystem',   'boost_program_options', 'boost_date_time' ])  #       add library search path env.append(libpath = ['/usr/lib','/usr/local/lib', '/opt/lib'])  # compile , link binary env.program('hello',['exa.cc'])      
Comments
Post a Comment