Author Topic: new WxWidgets project build failed  (Read 12403 times)

Offline qrees

  • Single posting newcomer
  • *
  • Posts: 6
new WxWidgets project build failed
« on: November 14, 2010, 05:09:20 pm »
Ok, I've installed WxWidgets 2.8 and Code::Blocks 10.05 with WxSmith plugin and have some problems with compiling programs or rather creating new projects.

1. I select new WxWidget project.
2. Select WxWidgets version 2.8
3. Select WxSmith gui builder and Application type: Dialog based
4. Select correct WxWidgets location
5. Select debug and release build, dll library version, no Miscellaneus options, no additional libraries.
6. Project gets created with example dialog and text "Welcome to WxWidgets", great.
7. Click "build" - FAIL -

Code
Compiling: resource.rc
Linking executable: bin\Debug\ex_test.exe
(...)./libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
1 errors, 0 warnings

Not so strage because all source files are all empty (all created cpp and h files are empty). There is something wrong with wizard, or it's normal??

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: new WxWidgets project build failed
« Reply #1 on: November 14, 2010, 07:40:06 pm »
Learn to post in the correct forum in the future.
Please continue this post in this thread; in time a admin will move it to the proper forum.
Note: You are not as likely to get help in this forum so you will need to wait more for help.

Turn on Full Compiler Logging and post the rebuild log
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

This will help to confirm if the compiler setup is a cause or not.

What OS and its version are you using?
Did you Compile wxWidgets or install wxPack?
If compiled wxWidgets, what command did you use?
If installed wxPack, what version did you use?

Tim S.
« Last Edit: November 14, 2010, 07:43:15 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline qrees

  • Single posting newcomer
  • *
  • Posts: 6
Re: new WxWidgets project build failed
« Reply #2 on: November 14, 2010, 07:51:13 pm »
Learn to post in the correct forum in the future.
Please continue this post in this thread; in time a admin will move it to the proper forum.
Note: You are not as likely to get help in this forum so you will need to wait more for help.

Turn on Full Compiler Logging and post the rebuild log
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

This will help to confirm if the compiler setup is a cause or not.

What OS and its version are you using?
Did you Compile wxWidgets or install wxPack?

Tim S.

Sorry for posting in wrong forum.

This is log for build command:
Code
windres.exe -i J:\Dropbox\projekty\test\resource.rc -J rc -o obj\Debug\resource.res -O coff -IG:\MinGW\wxWidgets\wxWidgets2.8\include -IG:\MinGW\wxWidgets\wxWidgets2.8\lib\gcc_dll\mswd -IG:\MinGW\bin 
mingw32-g++.exe -LG:\MinGW\wxWidgets\wxWidgets2.8\lib\gcc_dll -LG:\MinGW\bin  -o bin\Debug\test.exe  obj\Debug\resource.res  -mthreads  -lwxmsw28d  -mwindows
G:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
1 errors, 0 warnings

Windows XP Pro SP3
I used wxPack_v2.8.11.03.exe
« Last Edit: November 14, 2010, 07:55:29 pm by qrees »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: new WxWidgets project build failed
« Reply #3 on: November 14, 2010, 08:14:03 pm »

Windows XP Pro SP3
I used wxPack_v2.8.11.03.exe


Use an Compiler/wxPack combination that works together.
I believe that wxPack is using DW2 instead of SJLJ as used in MinGW GCC 3.4.5.
Do you know that this is NOT your problem?

From http://wxpack.sourceforge.net/
Quote
10/18/2010
There is a new release of wxPack that supports wxWidgets v2.8.11. It now supports OBDC connections. This release only has MinGW GCC v4.4.1-tdm_dw2 and Microsoft Visual C++ 8.0 libraries included. Please give feedback.

Tim S.

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

Offline qrees

  • Single posting newcomer
  • *
  • Posts: 6
Re: new WxWidgets project build failed
« Reply #4 on: November 14, 2010, 08:47:13 pm »
Use an Compiler/wxPack combination that works together.
I believe that wxPack is using DW2 instead of SJLJ as used in MinGW GCC 3.4.5.
Do you know that this is NOT your problem?

From http://wxpack.sourceforge.net/
Quote
10/18/2010
There is a new release of wxPack that supports wxWidgets v2.8.11. It now supports OBDC connections. This release only has MinGW GCC v4.4.1-tdm_dw2 and Microsoft Visual C++ 8.0 libraries included. Please give feedback.

Tim S.
I don't think this is WxWidgets poblem. As I said before, the files (*.cpp and *.h) that are generated by Code::Blocks wizard are empty, and Code::Blocks never tries to compile them.

Also I'm using mingw with g++ version 4.5.0 which should be compatile with WxPAck.

Also I believe that I have never version (or the same one) than described in quoted by you post.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: new WxWidgets project build failed
« Reply #5 on: November 14, 2010, 08:50:35 pm »
I do NOT believe you!!

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

Offline qrees

  • Single posting newcomer
  • *
  • Posts: 6
Re: new WxWidgets project build failed
« Reply #6 on: November 14, 2010, 08:53:04 pm »
I do NOT believe you!!
Which part you don't believe? ;)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: new WxWidgets project build failed
« Reply #7 on: November 14, 2010, 08:57:29 pm »
G:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16'

The above shows that you were using MinGW 3.4.5 version of the Compiler; or you have your compiler completely damaged.

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

Offline qrees

  • Single posting newcomer
  • *
  • Posts: 6
Re: new WxWidgets project build failed
« Reply #8 on: November 14, 2010, 09:04:45 pm »
G:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16'

The above shows that you were using MinGW 3.4.5 version of the Compiler; or you have you compiler completely damaged.

Tim S.
Yes, but I've reinstalled mingw, wxWidgets and Code::Blocks to newer versions after your posts and the result is the same.
Code
-------------- Build: Debug in test ---------------

mingw32-g++.exe -LG:\MinGW-4\wxWidgets\wxWidgets2.8\lib\gcc_dll -LG:\MinGW-4\bin  -o bin\Debug\test.exe  obj\Debug\resource.res  -mthreads  -lwxmsw28d  -mwindows
g:/mingw-4/bin/../lib/gcc/mingw32/4.5.0/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 3 seconds)
1 errors, 0 warnings

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: new WxWidgets project build failed
« Reply #9 on: November 14, 2010, 09:23:49 pm »
I can NOT duplicate the problem; using Code::Blocks 10.05.

1. Have "Skip next Page" Unchecked
2. Select "wxWidgets 2.8.x"
3. Project Title "TestwxSmith" with valid path that has no spaces or special characters
4. Left blank Author info
5. Select WxSmith gui builder and Application type: Dialog based
6. Used "$(#wx)" as wxWidgets location
7. Checked both Debug and Release
8. Checked Use DLL, Monolithic, and Configure Advanced Options
9. Verified that __WXDEUG__ is not checked and GUI Mode is checked for both targets

And, I get several source code files each of them has code in them.

What warning messages do you get doing the above steps?
I got several because I only have Unicode wxWidgets installed.


The below is a Guess on My part.
Note: You are likely to have edited the templates and made them blank.
The simplest  solution is to exit out of Code::Blocks; uninstall it and delete the Configuration files.
And, then re-install Code::Blocks.

%APPDATA%\Codeblocks should have the configuration files inside them. You must manually delete or rename the Config the un-installing will not remove them.


« Last Edit: November 14, 2010, 09:28:10 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline qrees

  • Single posting newcomer
  • *
  • Posts: 6
Re: new WxWidgets project build failed
« Reply #10 on: November 14, 2010, 09:39:24 pm »
I can NOT duplicate the problem; using Code::Blocks 10.05.

1. Have "Skip next Page" Unchecked
2. Select "wxWidgets 2.8.x"
3. Project Title "TestwxSmith" with valid path that has no spaces or special characters
4. Left blank Author info
5. Select WxSmith gui builder and Application type: Dialog based
6. Used "$(#wx)" as wxWidgets location
7. Checked both Debug and Release
8. Checked Use DLL, Monolithic, and Configure Advanced Options
9. Verified that __WXDEUG__ is not checked and GUI Mode is checked for both targets

And, I get several source code files each of them has code in them.

What warning messages do you get doing the above steps?
I got several because I only have Unicode wxWidgets installed.


The below is a Guess on My part.
Note: You are likely to have edited the templates and made them blank.
The simplest  solution is to exit out of Code::Blocks; uninstall it and delete the Configuration files.
And, then re-install Code::Blocks.

%APPDATA%\Codeblocks should have the configuration files inside them. You must manually delete or rename the Config the un-installing will not remove them.
No, I've never touched template files (until like 2 hours ago I didn't know I can ;) ).

BUT now I've reproduced the problem:

Repeat all the previous steps, but as Author name insert any non ASCII characters (ok, I don't exactly know which characters couse problems). You will get project with only resource files, no source code files. Example characters that couse problems (I don't if you will see then correctly):
Code
ęąśłżźćń

@stahta01 : I'm really greatfull for your patience and help :)

[edit]
To confirm that it really was the problem, I've successfully compiled new project with empty Author name.
« Last Edit: November 14, 2010, 09:53:27 pm by qrees »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: new WxWidgets project build failed
« Reply #11 on: November 14, 2010, 10:26:38 pm »
The problem also exits in current nightly build (14Nov2010); tested using "Tiń" as author name under Windows 1252 char-set.

Changing to UTF-8 did NOT fix the problem.

Submitted Bug
https://developer.berlios.de/bugs/?func=detailbug&bug_id=17715&group_id=5358

Tim S.
« Last Edit: November 14, 2010, 10:39:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: new WxWidgets project build failed
« Reply #12 on: November 30, 2010, 04:18:19 pm »
The problem also exits in current nightly build (14Nov2010); tested using "Tiń" as author name under Windows 1252 char-set.

Changing to UTF-8 did NOT fix the problem.

Submitted Bug
https://developer.berlios.de/bugs/?func=detailbug&bug_id=17715&group_id=5358

Tim S.

This bug is now fixed in trunk. Thanks for reporting.
Be a part of the solution, not a part of the problem.