Author Topic: cant' compile console app after adding wxWidgets paths  (Read 5680 times)

Offline art1221

  • Multiple posting newcomer
  • *
  • Posts: 11
cant' compile console app after adding wxWidgets paths
« on: November 17, 2013, 03:08:17 pm »
I can compile wxWidgets apps now, but not console apps. Strange...

paths in Search directories are:

For compiler:

C:\CodeBlocks\MinGW\include
C:\CodeBlocks\MinGW\x86_64-w64-mingw32\include
C:\CodeBlocks\MinGW\lib\gcc\x86_64-w64-mingw32\4.8.1\include
C:\wxWidgets3.0.0\include
C:\wxWidgets3.0.0\lib\gcc_dll\mswu
C:\wxWidgets3.0.0\lib\gcc_dll

For linker:

C:\CodeBlocks\MinGW\lib
C:\CodeBlocks\MinGW\x86_64-w64-mingw32\lib
C:\wxWidgets3.0.0\lib\gcc_dll

Build log:

x86_64-w64-mingw32-g++.exe -Wall -fexceptions  -O2  -std=c++11 -w -m64   -IC:\CodeBlocks\MinGW\include -IC:\CodeBlocks\MinGW\x86_64-w64-mingw32\include -IC:\CodeBlocks\MinGW\lib\gcc\x86_64-w64-mingw32\4.8.1\include -IC:\wxWidgets3.0.0\include -IC:\wxWidgets3.0.0\lib\gcc_dll\mswu -IC:\wxWidgets3.0.0\lib\gcc_dll  -c C:\_C++\PROJECTS\Films\BoostFunc.cpp -o obj\Release\BoostFunc.o
                                ^
« Last Edit: November 17, 2013, 03:53:11 pm by art1221 »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: cant' compile console app after adding wxWidgets paths
« Reply #1 on: November 17, 2013, 03:41:03 pm »
1) Use code tags for this type of info
2) post the full build log in yours the error is missing

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline art1221

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: cant' compile console app after adding wxWidgets paths
« Reply #3 on: November 17, 2013, 04:19:24 pm »
path to boost has been deleted and that have produced the first error. Now after adding Boost to compiler and linker settings I am getting quite different error. I have never used c-tags... yet....


x86_64-w64-mingw32-g++.exe -LC:\CodeBlocks\MinGW\lib -LC:\CodeBlocks\MinGW\x86_64-w64-mingw32\lib -LC:\wxWidgets3.0.0\lib\gcc_dll -LC:\Boost\lib  -o bin\Release\TEST.exe obj\Release\Derrick_Catalog.o obj\Release\EmuleFolder.o obj\Release\Files_Dirs.o obj\Release\main.o obj\Release\Menu.o obj\Release\Strings.o obj\Release\TextProccessing.o obj\Release\Utils.o  obj\Release\FilmInfo.res  -s -Wl,--allow-multiple-definition  
c:/codeblocks/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: obj\Release\Derrick_Catalog.o: bad reloc address 0x166 in section `.text.startup'
collect2.exe: error: ld returned 1 exit status
« Last Edit: November 17, 2013, 04:20:56 pm by art1221 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: cant' compile console app after adding wxWidgets paths
« Reply #4 on: November 17, 2013, 04:49:41 pm »
http://cboard.cprogramming.com/c-programming/announcement-posting-code-read-first.html

I suggest Posting the full Build log in code tags or you will likely be ignored.

This means do a re-build instead of a build.
This means use code tags!

My full rebuild log

Code
-------------- Build: Release in console_wx30 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -pipe -mthreads -Wno-attributes -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -O2 -Wmissing-include-dirs -Wno-unused-local-typedefs -IE:\OpenSourceCode\Libs\GUI\wxWidgets\wxWidgets-3.0.x-MonoLib-SJLJ\include -IE:\OpenSourceCode\Libs\GUI\wxWidgets\wxWidgets-3.0.x-MonoLib-SJLJ\lib\gcc_dllmulti_mgw481_wx30\mswu -c E:\OpenSourceCode\Libs\GUI\wxWidgets\wxWidgets-3.0.x-MonoLib-SJLJ\samples\console\console.cpp -o .objs\Release\console\console.o
mingw32-g++.exe -LE:\OpenSourceCode\Libs\GUI\wxWidgets\wxWidgets-3.0.x-MonoLib-SJLJ\lib\gcc_dllmulti_mgw481_wx30 -o bin\Release\console.exe .objs\Release\console\console.o  -s -mthreads -lwxbase30u -lwxmsw30u_core -lwxmsw30u_adv  
Output file is bin\Release\console.exe with size 526.00 KB

Notice I linked to the wxWidgets base library "-lwxbase30u"; I have no idea if console libs can be built linking to monolithic DLL. It does work with Monolib.
These libs are not likely needed "-lwxmsw30u_core -lwxmsw30u_adv".

The run command below.
Code
-------------- Run: Release in console_wx30 (compiler: GNU GCC Compiler)---------------

Checking for existence: E:\OpenSourceCode\Libs\GUI\wxWidgets\wxWidgets-3.0.x-MonoLib-SJLJ\samples\cb_build\bin\Release\console.exe
Executing: "C:\GreenApps\CB_UOI_9398/cb_console_runner.exe" "E:\OpenSourceCode\Libs\GUI\wxWidgets\wxWidgets-3.0.x-MonoLib-SJLJ\samples\cb_build\bin\Release\console.exe"  (in E:\OpenSourceCode\Libs\GUI\wxWidgets\wxWidgets-3.0.x-MonoLib-SJLJ\samples\cb_build\.)

Tim S.
« Last Edit: November 17, 2013, 05:12:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline art1221

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: cant' compile console app after adding wxWidgets paths
« Reply #5 on: November 17, 2013, 05:23:38 pm »
UPDATE: fixed.

First error was - when setting wxWidgets path to Boost libs has been accidentally deleted.

The second error has been produced by an unchecked .cpp file in Properties... ---> Build Targets --> Built Target files.

I do not remember  unchecking that  file....