Author Topic: cannot find -1C:\wxWidgets-3.1.3  (Read 788 times)

Offline HairyHugh

  • Single posting newcomer
  • *
  • Posts: 7
  • Retired but going back to what I used to do
cannot find -1C:\wxWidgets-3.1.3
« on: June 19, 2020, 12:20:09 pm »
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

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 572
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #1 on: June 19, 2020, 12:49:11 pm »
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

Offline HairyHugh

  • Single posting newcomer
  • *
  • Posts: 7
  • Retired but going back to what I used to do
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #2 on: June 19, 2020, 02:08:34 pm »
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

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 572
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #3 on: June 19, 2020, 02:28:42 pm »
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.

Offline HairyHugh

  • Single posting newcomer
  • *
  • Posts: 7
  • Retired but going back to what I used to do
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #4 on: June 19, 2020, 04:19:04 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7013
    • My Best Post
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #5 on: June 19, 2020, 04:27:20 pm »
Did you check the linker settings tab?

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

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 572
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #6 on: June 19, 2020, 04:28:07 pm »
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

Offline HairyHugh

  • Single posting newcomer
  • *
  • Posts: 7
  • Retired but going back to what I used to do
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #7 on: June 19, 2020, 04:47:43 pm »
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

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 572
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #8 on: June 19, 2020, 05:48:12 pm »
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.

Offline HairyHugh

  • Single posting newcomer
  • *
  • Posts: 7
  • Retired but going back to what I used to do
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #9 on: June 19, 2020, 06:08:32 pm »
OK I am with you now, file attached
Claiming sanity is the first sign of madness
Spilling beer is a crime

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 572
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #10 on: June 19, 2020, 06:25:46 pm »
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
« Last Edit: June 19, 2020, 06:45:00 pm by Miguel Gimenez »

Offline HairyHugh

  • Single posting newcomer
  • *
  • Posts: 7
  • Retired but going back to what I used to do
Re: cannot find -1C:\wxWidgets-3.1.3
« Reply #11 on: June 19, 2020, 07:08:59 pm »
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