User forums > General (but related to Code::Blocks)

cannot find -1C:\wxWidgets-3.1.3

(1/3) > >>

I am following the PB's Guide to starting with xwWidgets on Microsoft Windows with MinGW and Code::Blocks. I am using Windows10, on a 64 bit system. I have set WXWIN correctly (CMD.exe and cd %WXWIN" works OK).
I am using wxWidgets-3.1.3, Code::Blocks 20.03 and C:\mingw-w64\i686-8.1.0-posix-sjlj-rt_v6-rev0
I have gone through the whole process and successfully run the wxWidgets minimal sample prior to using Code:Blocks.
However when trying to compile and run the test app in Code::Blocks I get an error:
ld.exe cannot find -1C:\wxWidgets. I have double checked all of the options I can see and they all look OK. Also searched for this error message but not found it anywhere.
I assume I am missing some directive but am unable to find it.

Miguel Gimenez:
You are using the digit '1' and it is an invalid option. This option should be added automatically by C::B, so you must be messing something in the project options.

Please post a full rebuild log:

Hi Miguel
Thanks for response. Not sure where the 1 comes from, I cannot see it anywhere in options. Full build log below
-------------- Build: Debug in Test (compiler: mingw-w64-i686-8.1.0-posix-sjlj)---------------

windres.exe -IC:\wxWidgets-3.1.3\include -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud  -J rc -O coff -i C:\Users\Hugh\DOCUME~1\MYSOFT~1\CODEBL~1\Test\resource.rc -o obj\Debug\resource.res
g++.exe -Wall -std=c++17 -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -D__WXDEBUG__ -IC:\wxWidgets-3.1.3\include -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud -c C:\Users\Hugh\Documents\MySoftware\CodeBlocks\Test\TestApp.cpp -o obj\Debug\TestApp.o
g++.exe -Wall -std=c++17 -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -D__WXDEBUG__ -IC:\wxWidgets-3.1.3\include -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud -c C:\Users\Hugh\Documents\MySoftware\CodeBlocks\Test\TestMain.cpp -o obj\Debug\TestMain.o
g++.exe -LC:\wxWidgets-3.1.3\lib\gcc_dll -o bin\Debug\Test.exe  obj\Debug\TestApp.o obj\Debug\TestMain.o obj\Debug\resource.res -mthreads  -lwxmsw31ud_richtext -lwxmsw31ud_xrc -lwxmsw31ud_aui -lwxmsw31ud_media -lwxbase31ud_net -lwxmsw31ud_gl -lwxbase31ud_xml -lwxmsw31ud_adv -lwxmsw31ud_html -lwxmsw31ud_core -lwxbase31ud -lwxpngd -lwxjpegd -lwxtiffd -lwxzlibd -lwxregexud -lwxexpatd -lC:\wxWidgets-3.1.3 -mwindows
C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-sjlj-rt_v6-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lC:\wxWidgets-3.1.3
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 14 second(s))
2 error(s), 0 warning(s) (0 minute(s), 14 second(s))

Miguel Gimenez:
C::B uses a lower case 'L', probably you mistook it for a '1' when writing the subject.
The -l option specifies a file to link, you are supplying a folder instead. Look for C:\wxWidgets3.1.3 in Linker settings -> Link libraries and remove it.

I have looked under projects\build options and setting\compiler and cannot find it anywhere there.


[0] Message Index

[#] Next page

Go to full version