News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

windows build error

Started by codelighter, April 04, 2018, 11:11:03 AM

Previous topic - Next topic

codelighter

-------------- 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!

stahta01

Remove "C:\wxWidgets" from the library list where you added it.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

codelighter

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?

codelighter

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.

stahta01

#4
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

codelighter

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.

codelighter

This is the only place I add C:\wxWidgets in IDE, but this is the correct way.

stahta01

#7
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

codelighter

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?

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

codelighter

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 

codelighter

The build process result is succeed. but some packages always missing.

stahta01

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

Tim S.


C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

codelighter

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.