Author Topic: clarify the link list  (Read 14766 times)

Offline SpaceCadet

  • Multiple posting newcomer
  • *
  • Posts: 22
clarify the link list
« on: August 17, 2022, 08:44:59 pm »
Before I go any further I want to celebrate codeblocks and thank everyone for creating it !! I created a bare bones project using the GTK+ option on freebsd13.  Note that I have built and installed wx32.  I generate the project, then build it with no changes.  if I have address sanitation turned on it locks up.  After a lot of effort and time I found the flag in compiler settings and turned off address sanitation.  then it worked.  I looked in the link list and there are NO libraries in the list.  Yet when I build the project it links in all the wxgtk libraries USING the WX32 versions.  magic!  how did it know?  the problem:  It lies in the fact I have no known way to edit the link list.  I like how codeblocks works and how it automatically somehow got the links all in the right place.  But the fact the link list is not where it appears you can edit it.  And the choices you have of appending or prepending target or project are awkward.  It would help if the automatically generated links all dump into the gui, and the compiler builds its link list from that link list in the GUI, instead of automatically generating some of the libraries in hiding.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: clarify the link list
« Reply #1 on: August 17, 2022, 10:42:16 pm »
There is no "magic" in codeblocks. I suspect you are using linux? Then there is probably a '`wx-config --libs`' in the linker tab -> other linker options. This is a command line tool provided by wxWidgets on linux to automatically gather all needed information to link wxWidgets. You can type wx-config --help in a terminal window and see all possible options...

Offline SpaceCadet

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: clarify the link list
« Reply #2 on: August 18, 2022, 08:33:08 pm »
There is no "magic" in codeblocks. I suspect you are using linux? Then there is probably a '`wx-config --libs`' in the linker tab -> other linker options. This is a command line tool provided by wxWidgets on linux to automatically gather all needed information to link wxWidgets. You can type wx-config --help in a terminal window and see all possible options...

I am using freebsd13.  I am familiar with wx-config but do not see it in the build log. It is cool that the project builds perfectly.  But a great deal of information is happening behind the scenes, aka magically.  I can't find where to edit it.  Since all the wx libraries that are linked do not appear in the gui, i fear what will happen when i want to link custom libraries.

You can look at if you want.  Here is the entire log:
-------------- Clean: Debug in aalearn (compiler: LLVM Clang Compiler)---------------

Cleaned "aalearn - Debug"

-------------- Build: Debug in aalearn (compiler: LLVM Clang Compiler)---------------

clang++ -Weverything -I/usr/local/lib/wx/include/gtk3-unicode-3.2 -I/usr/local/include/wx-3.2 -DWXUSINGDLL -D__WXGTK3__ -D__WXGTK__ -pthread -Wall -g -D__WXGTK3__ -D__WXGTK__ -ftrapv -m64 -w -g -std=c++14  -c /hd2/wkspc/cb_wkspc/aalearn/aalearnApp.cpp -o obj/Debug/aalearnApp.o
clang++ -Weverything -I/usr/local/lib/wx/include/gtk3-unicode-3.2 -I/usr/local/include/wx-3.2 -DWXUSINGDLL -D__WXGTK3__ -D__WXGTK__ -pthread -Wall -g -D__WXGTK3__ -D__WXGTK__ -ftrapv -m64 -w -g -std=c++14  -c /hd2/wkspc/cb_wkspc/aalearn/aalearnMain.cpp -o obj/Debug/aalearnMain.o
clang++  -o bin/Debug/aalearn obj/Debug/aalearnApp.o obj/Debug/aalearnMain.o  -L/usr/local/lib -pthread -lwx_gtk3u_xrc-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_qa-3.2 -lwx_gtk3u_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2  -m64 
Output file is bin/Debug/aalearn with size 1.07 MB
Process terminated with status 0 (0 minute(s), 7 second(s))
0 error(s), 0 warning(s) (0 minute(s), 7 second(s))
 

Offline SpaceCadet

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: clarify the link list
« Reply #3 on: August 18, 2022, 08:35:04 pm »
I forgot to add, compiler options is blank, link libraries box is blank, and other link options is also blank.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1635
Re: clarify the link list
« Reply #4 on: August 18, 2022, 08:38:49 pm »
The log shows the output of wx-config, not the command.
Regarding options, there are two sets: one in global compiler options and the other in Build options.

You can also open the CBP with a text editor and look for the wx-config call.

Online Commaster

  • Almost regular
  • **
  • Posts: 171
Re: clarify the link list
« Reply #5 on: August 18, 2022, 09:30:03 pm »
The "magic" is part of the standard shell (i.e. bash): backticks(``). (Random stackoverflow about them: https://unix.stackexchange.com/a/27432 )
We put the backticked wx-config in the line and the shell executes it for us and replaces with the output.
Hopefully this solves the "magic" part :)

P.S. backticked wx-config lines are part of the standard config as explained before.

Offline SpaceCadet

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: clarify the link list
« Reply #6 on: August 19, 2022, 02:17:55 am »
Miguel and Commaster, thanks!  I found the *.cbp file and see the wx-config lines.