Code::Blocks Forums

User forums => Help => Topic started by: ericjoe on October 08, 2015, 11:13:29 am

Title: ld.exe cannot find -lboost although I can open "#include <boost/*>
Post by: ericjoe on October 08, 2015, 11:13:29 am
Dear members,

I am opening another sample project, which uses boost libraries.

After I change the "Build Options..." at the "Project Name", I tried to right-click open "#include <boost/algorithm/string.hpp>" and it works. I can view string.hpp file.

However when I build the project, I got an error message saying "ld.exe cannot find -lboost_*" for all the boost libraries.

Please refer to the screenshots below and the "Build Log".

1) Build Log
Code
-------------- Build: Debug in MERIT (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -L"..\..\..\Program Files\CodeBlocks\lib" -L"..\..\..\Program Files\CodeBlocks\boost" -L"..\..\..\..\..\Program Files\CodeBlocks" -o bin\Debug\MERIT.exe obj\Debug\Calcs.o obj\Debug\Cam2.o obj\Debug\CongestedArea.o obj\Debug\CopyProtection.o obj\Debug\DatabaseIO.o obj\Debug\ErrorReporting.o obj\Debug\EventTree.o obj\Debug\ExcelInputParser.o obj\Debug\Explosion.o obj\Debug\Grid.o obj\Debug\GridArea.o obj\Debug\GridPoint.o obj\Debug\IgnitionArea.o obj\Debug\ImageWriter.o obj\Debug\Logger.o obj\Debug\Metreology.o obj\Debug\PopulationArea.o obj\Debug\QRAModel.o obj\Debug\ReceiverArea.o obj\Debug\Simulation.o obj\Debug\sqlite3.o obj\Debug\Utilities.o obj\Debug\WorkerGroup.o   -lboost_chrono-mgw47-mt-1_47 -lboost_chrono-mgw47-mt-d-1_47 -lboost_date_time-mgw47-mt-1_47 -lboost_date_time-mgw47-mt-d-1_47 -lboost_exception-mgw47-mt-1_47 -lboost_exception-mgw47-mt-d-1_47 -lboost_filesystem-mgw47-mt-1_47 -lboost_filesystem-mgw47-mt-d-1_47 -lboost_graph-mgw47-mt-1_47 -lboost_graph-mgw47-mt-d-1_47 -lboost_iostreams-mgw47-mt-1_47 -lboost_iostreams-mgw47-mt-d-1_47 -lboost_math_c99f-mgw47-mt-1_47 -lboost_math_c99f-mgw47-mt-d-1_47 -lboost_math_c99l-mgw47-mt-1_47 -lboost_math_c99l-mgw47-mt-d-1_47 -lboost_math_c99-mgw47-mt-1_47 -lboost_math_c99-mgw47-mt-d-1_47 -lboost_math_tr1f-mgw47-mt-1_47 -lboost_math_tr1f-mgw47-mt-d-1_47 -lboost_math_tr1l-mgw47-mt-1_47 -lboost_math_tr1l-mgw47-mt-d-1_47 -lboost_math_tr1-mgw47-mt-1_47 -lboost_math_tr1-mgw47-mt-d-1_47 -lboost_prg_exec_monitor-mgw47-mt-1_47 -lboost_prg_exec_monitor-mgw47-mt-d-1_47 -lboost_program_options-mgw47-mt-1_47 -lboost_program_options-mgw47-mt-d-1_47 -lboost_random-mgw47-mt-1_47 -lboost_random-mgw47-mt-d-1_47 -lboost_regex-mgw47-mt-1_47 -lboost_regex-mgw47-mt-d-1_47 -lboost_serialization-mgw47-mt-1_47 -lboost_serialization-mgw47-mt-d-1_47 -lboost_signals-mgw47-mt-1_47 -lboost_signals-mgw47-mt-d-1_47 -lboost_system-mgw47-mt-1_47 -lboost_system-mgw47-mt-d-1_47 -lboost_test_exec_monitor-mgw47-mt-1_47 -lboost_test_exec_monitor-mgw47-mt-d-1_47 -lboost_unit_test_framework-mgw47-mt-1_47 -lboost_unit_test_framework-mgw47-mt-d-1_47 -lboost_wave-mgw47-mt-1_47 -lboost_wave-mgw47-mt-d-1_47 -lboost_wserialization-mgw47-mt-1_47 -lboost_wserialization-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_chrono-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_chrono-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_date_time-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_date_time-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_exception-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_exception-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_filesystem-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_filesystem-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_graph-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_graph-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_iostreams-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_iostreams-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_c99f-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_c99f-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_c99l-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_c99l-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_c99-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_c99-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_tr1f-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_tr1f-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_tr1l-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_tr1l-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_tr1-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_math_tr1-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_prg_exec_monitor-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_prg_exec_monitor-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_program_options-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_program_options-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_random-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_random-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_regex-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_regex-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_serialization-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_serialization-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_signals-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_signals-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_system-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_system-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_test_exec_monitor-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_test_exec_monitor-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_unit_test_framework-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_unit_test_framework-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_wave-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_wave-mgw47-mt-d-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_wserialization-mgw47-mt-1_47
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lboost_wserialization-mgw47-mt-d-1_47
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
46 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

2)Link Libraries - With "Project" selected at the left menu panel:
(http://s21.postimg.org/6lbgug7p3/library.png)

3)Project build options -> Search directories -> Compiler and Linker
(http://s11.postimg.org/j4cn7zogz/library_2.png)

Can you suggest me how do I solve the build error?

Thank you
Title: Re: ld.exe cannot find -lboost although I can open "#include <boost/*>
Post by: stahta01 on October 08, 2015, 02:58:12 pm
Learning how to post a full build log on a site that support your Compiler and using the Boost libraries would be the fastest way to solve your problem.  http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

I have no plans to help you because you seem unable to learn how to post a full build log.

Tim S.

Title: Re: ld.exe cannot find -lboost although I can open "#include <boost/*>
Post by: ericjoe on October 08, 2015, 03:44:58 pm
Learning how to post a full build log on a site that support your Compiler and using the Boost libraries would be the fastest way to solve your problem.  http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

I have no plans to help you because you seem unable to learn how to post a full build log.

Tim S.

Hi Tim,

I have posted a full build log in my first post.

Or have I used the wrong method to post a full build log?

Enlighten me if possible.

Thank you.
Title: Re: ld.exe cannot find -lboost although I can open "#include <boost/*>
Post by: scarphin on October 08, 2015, 07:04:18 pm
1- Do your library files have an extension?
2- Do you know what for the
Code
..\
symbol is used?
Title: Re: ld.exe cannot find -lboost although I can open "#include <boost/*>
Post by: stahta01 on October 09, 2015, 01:01:38 am
Learning how to post a full build log on a site that support your Compiler and using the Boost libraries would be the fastest way to solve your problem.  http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

I have no plans to help you because you seem unable to learn how to post a full build log.

Tim S.

Hi Tim,

I have posted a full build log in my first post.

Or have I used the wrong method to post a full build log?

Enlighten me if possible.

Thank you.

Step 1. Learn the difference between re-build and build.
Step 2. Use re-build instead of build.

Hint: Re-build is often just clean followed by build.

Hint2: DO NOT add as many libraries as you can when you DO NOT need all of them!
Hint3: Learn what a debug and a release library is. Do NOT include both types in the library list for a single library!

Tim S.