News:

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

Main Menu

cannot find -1C:\wxWidgets-3.1.3

Started by HairyHugh, June 19, 2020, 12:20:09 PM

Previous topic - Next topic

HairyHugh

Hi
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.
Claiming sanity is the first sign of madness
Spilling beer is a crime

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:

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

HairyHugh

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))
Claiming sanity is the first sign of madness
Spilling beer is a crime

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.

HairyHugh

I have looked under projects\build options and setting\compiler and cannot find it anywhere there.
Claiming sanity is the first sign of madness
Spilling beer is a crime

stahta01

Did you check the linker settings tab?

Both "Link Libraries" and "other linker options".

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]

Miguel Gimenez

Each target has his own set of options, you must look in both Debug and Test nodes.

You can also attach the CBP file here, or open it with a text editor and search for C:\wxWidgets-3.1.3

HairyHugh

Hi Tim,
Not in either under debug or release.
Miguel
Did you mean to add a link for the CBP file or am I not understanding you
Claiming sanity is the first sign of madness
Spilling beer is a crime

Miguel Gimenez

I mean attach the Test.CBP file (only) to your reply, using the "Attachments and other options" below. The extensions are restricted, so you must change it (from CBP to TXT, for example) or create a ZIP.

HairyHugh

OK I am with you now, file attached
Claiming sanity is the first sign of madness
Spilling beer is a crime

Miguel Gimenez

#10
It is not in the CBP, so it must be in the global compiler settings:

Settings  -> Compiler settings -> Linker settings -> Link libraries

Possibly it is disguised as $(#wx)

EDIT: select compiler "mingw-w64-i686-810-posix-sjlj" if it is not the default

HairyHugh

Many thanks, somehow I managed to get $(#wx.BASE) incorporated.
Working now, so now to build a real app
Claiming sanity is the first sign of madness
Spilling beer is a crime