-------------- Build: Debug in demo (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -LC:\wxWidgets\lib\gcc_lib -LC:\wxWidgets -o bin\Debug\demo.exe obj\Debug\demoApp.o obj\Debug\demoMain.o obj\Debug\resource.res -mthreads -lwxmsw31ud_xrc -lwxmsw31ud_aui -lwxbase31ud_net -lwxmsw31ud_gl -lwxbase31ud_xml -lwxmsw31ud_adv -lwxmsw31ud_html -lwxmsw31ud_core -lwxbase31ud -lwxpngd -lwxjpegd -lwxtiffd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -lC:\wxWidgets -mwindows
C:/code_blocks/MinGW/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: cannot find -lC:\wxWidgets
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 2 second(s))
2 error(s), 0 warning(s) (0 minute(s), 2 second(s))
;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D
Above errors appear when I want to build a wxWidgets 3.1.1 basic dialog-based project in Code::Blocks using mingw23-g++.exe, I wanna to know how to fix it. Thanks!
Remove "C:\wxWidgets" from the library list where you added it.
Tim S.
Quote from: stahta01 on April 04, 2018, 11:26:50 AM
Remove "C:\wxWidgets" from the library list where you added it.
Tim S.
I checked many config and settings, still can't find where the library list locate? can you show me more details?
Quote from: stahta01 on April 04, 2018, 11:26:50 AM
Remove "C:\wxWidgets" from the library list where you added it.
Tim S.
following is the linker screenshot, the
C:\wxWidgets can't be found in the dialog, but the debugger still run error.
Check under the project setting by clicking on demo in the left hand pane.
Edit: Also, use the scroll down arrow to see if it is below the ones listed in the screen shot for the debug target.
Tim S.
Quote from: stahta01 on April 04, 2018, 11:47:38 AM
Check under the project setting by clicking on demo in the left hand pane.
Edit: Also, use the scroll down arrow to see if it is below the ones listed in the screen shot for the debug target.
Tim S.
I have checked the linker setting and other tabs many times, still can't find why the IDE output the wrong link options.
This is the only place I add C:\wxWidgets in IDE, but this is the correct way.
Did you check the project instead of the target settings?
Edit: Till you post a screen shot of the project settings, I will believe you have failed to check them!
Did you check the global compiler linker settings?
Tim S.
Quote from: stahta01 on April 04, 2018, 12:07:54 PM
Did you check the project instead of the target settings?
Edit: Till you post a screen shot of the project settings, I will believe you have failed to check them!
Did you check the global compiler linker settings?
Tim S.
You are RIGHT! , I remove the
$(#wx) item in the global linker setting. afterwards I encounter a new problem when building. How to solve it?
You need to add the libraries needed to fix the linking errors.
Edit: "Undefined Reference" errors are linking errors.
Note: The order of libraries matter for some compilers.
Tim S.
Quote from: stahta01 on April 04, 2018, 12:21:59 PM
You need to add the libraries needed to fix the linking errors.
Note: The order of libraries matter for some compilers.
Tim S.
I don't well know which libraries these functions own to , I build the newest wxWidget 3.1.1 source code with following command lines. Advices about wxWidget 3.1.1 build process on windows platform would be appreciated.
@echo off
cd build/msw
title Compile wxWidgets
echo Start Compile ...
echo ---------------------------------------------------------------------
::echo Clean Env
::mingw32-make -f makefile.gcc clean
echo Compile Release Version
::SHARED=0, Static Link Library. SHARED=1, Dynamic Link Library.
::MONOLITHIC=0, Multiple Widgets. MONOLITHIC=1, Single Widgets.
::UNICODE=0, Not Support Unicode. Unicode=1, Support Unicode.
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=0 UNICODE=1 .
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=0 UNICODE=1
echo Compile Debug Version
mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=0 UNICODE=1
mingw32-make -f makefile.gcc BUILD=debug SHARED=1 MONOLITHIC=0 UNICODE=1
echo ---------------------------------------------------------------------
echo Compile Succeed.
pause
The build process result is succeed. but some packages always missing.
Till you learn to use code tags there is no way for me to help you without a lot of work on my part.
And, since the problem is likely Windows libraries are missing the Linux devs are not likely to help you.
Link to how to report a problem. It includes some paste to forum info.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Tim S.
You are likely missing one of these lib statements
-lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -loleacc
The last one tends to match the errors I saw the most.
Tim S.
Quote from: stahta01 on April 04, 2018, 12:54:07 PM
You are likely missing one of these lib statements
-lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 -loleacc
The last one tends to match the errors I saw the most.
Tim S.
Thanks very much. I would try it.
I have found a good way to set up
wxWidgets3.1.1 develop environment in
CodeBlocks 17.12 [windows ONLY].
- download CodeBlocks17.12 installer, please visit https://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Windows/codeblocks-17.12mingw-setup.exe/download (https://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Windows/codeblocks-17.12mingw-setup.exe/download)
- download wxWidgets 3.1.1 source code, please visit https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.7z (https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.7z)
- download wxWidgets 3.1.1 compiled DLLs, please visit https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.1 (https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.1), and click wxMSW-3.1.1_gcc510TDM_Dev.7z
- install CodeBlocks17.12, after finished,please config the MINGW-G++ compiler binary directory in global environment variable PATH,such as: C:\code_blocks\MinGW\bin;
- unzip wxWidgets3.1.1 source code to C: disk, such as C:\wxWidgets
- unzip wxWidgets3.1.1 compiled DLLs, and copy all the files in gcc510TDM_dll directory into above wxWidgets directory, the full path in my computer is C:\wxWidgets\lib\gcc_dll, remember to create directory gcc_dll if it not exists
- open CodeBlocks17.12 and create a new wxWidgets GUI project as following steps
guide | step notes |
7.1 | select which version of wxWidgets we will use, here we select wxWidgets3.1.x |
7.2 | give a name to our project and set its location. You can config any path in your desire |
7.3 | set author information, you can ignore this step |
7.4 | select Dialog based or Frame Based Progamming Model, it depends you need,here for simplicity, we select Dialog Based |
7.5 | set wxWidgets path, if you have already set global variable wx in CodeBlocks Setting tab, just fill $(#wx) ,otherwise fill the full wxWidgets installed path |
7.6 | select compiler, let it as default |
7.7 | make sure Use WxWidgets DLL 、Enable Unicode、Configure Advanced Options three options is selected |
7.7 | make sure two GUI Mode Application is selected |
7.8 | first select all items, then unselect wxDBGrid,wxOdbc,wxQa three items |
attachment is my successful screenshot.