Author Topic: wxFRED: March '13 Progress Report  (Read 9501 times)

0 Members and 1 Guest are viewing this topic.

Re: wxFRED: March '13 Progress Report
Hmm, still no dice. There's another backslash include in frmFRED2.cpp:25. But after fixing that, g++ fails to locate the #includes from wxFRED_base.h. All of them: if I comment one out, it simply fails on the next one.

Hey, that's exactly what happens for me, too!  :lol:
Well, I copied the include-statements from the WX_CFLAGS to any other CFLAGS and CXXFLAGS (CFLAGS and FS2_CFLAGS in Makefile and code/Makefile) and then it worked... Almost...
Small heads up on this one: I got it fixed by changing configure.ac:211 from
Code: [Select]
FS2_CXXFLAGS="$FS2_CXXFLAGS $WX_CXXFLAGS_ONLY"
to
Code: [Select]
FS2_CXXFLAGS="$FS2_CXXFLAGS $WX_CXXFLAGS"
Warning: this is based on hacking and experimentation, and may not be the preferred solution.

Yes, wxFRED is currently set up for static linking, since I was having problems with the dynamic linking not getting setup quite right. I also didn't know if Linux builds would properly run a .dll or not, so I scheduled tackling that whole problem for a later date.
I'm not 100% certain, but it looks like the Makefile is set up for dynamic linking with the WX libs. As it should be :)

BTW, .dll are Windows-only binaries, *nix has a different format for shared objects.

EDIT: Oh, and frmTeamLoadoutEditor.h is missing a comment sign on the last line.

EDIT2:
ONLY wxfred2.cpp should be compiled with -std=c++11 because otherwise, fsmemory.cpp fails to compile!
Hmm, how exactly did you do that? I edited -std=c++11 into code/Makefile manually for wxfred2.cpp, and am seeing it on the command line when I run make (like it should), yet still I get 'nullptr not declared in this scope'. g++ 4.7.2.
« Last Edit: March 19, 2013, 09:58:01 am by FreeSpaceFreak »

 
Re: wxFRED: March '13 Progress Report
Hmm, how exactly did you do that? I edited -std=c++11 into code/Makefile manually for wxfred2.cpp, and am seeing it on the command line when I run make (like it should), yet still I get 'nullptr not declared in this scope'. g++ 4.7.2.

I simply compiled everything without -std=c++11 until make failed. Then I added the flag and ran make again ;)

 
Re: wxFRED: March '13 Progress Report
I simply compiled everything without -std=c++11 until make failed. Then I added the flag and ran make again ;)
Hmm, I'm not an expert in the matter, but I wouldn't be surprised if that, ah, 'unconventional' setup might be related to your very long list of undefined references :P

Is FSO written for a specific C++ standard (e.g. C++11)? Adding compiler flags on a file-by-file basis is gonna get very messy very quickly...

 

Offline niffiwan

  • 211
  • Eluder Class
Re: wxFRED: March '13 Progress Report
I had a brief chat about this on IRC with z64555 a few days back, IIRC the only C++11 code is the use of the nullptr keyword and he was going to remove that, so maybe don't expend much effort on trying to get it working on Linux until he makes and posts those changes :)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
Made the changes wxfred2.cpp and frmFRED2.cpp to include <globalincs/pstypes.h> and replace the nullptr keyword with the standard NULL macro.

I'll see if I can upload it to the dropbox and fix the OP download links appropriately, but for now I've attached it to this post using HLP's server.

I found that MingW32 has the same api as g++, so I'll see if I can use it for a build or two and find out which pitfalls the code may have for *nix users... maybe even modify the Make file accordingly, too.



[attachment deleted by ninja]
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 
Re: wxFRED: March '13 Progress Report
OK, here's how I tried to compile it on g++:

- fs2_open/configure.ac:211: changed $WX_CXXFLAGS_ONLY to $WX_CXXFLAGS (see also reply #20)
- fs2_open/code/Makefile.am: from line 828 on, change
Code: (Makefile.am) [Select]
wxFRED_SOURCES = \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h \
wxfred2/fredframe.cpp \
wxfred2/fredframe.h \
wxfred2/wxfred_xrc.cpp \
wxfred2/wxfred_xrc.h
to
Code: (Makefile.am) [Select]
wxFRED_SOURCES = \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h

And then, behold... The linker fails on a very long list of undefined references :D Here's an excerpt:

Code: [Select]
libcode.a(keycontrol.o): In function `game_do_end_mission_popup()':
keycontrol.cpp:(.text+0x3211): undefined reference to `game_stop_time()'
keycontrol.cpp:(.text+0x3216): undefined reference to `game_stop_looped_sounds()'
keycontrol.cpp:(.text+0x32a4): undefined reference to `game_start_time()'
libcode.a(keycontrol.o): In function `button_function_demo_valid(int)':
keycontrol.cpp:(.text+0x41da): undefined reference to `Game_time_compression'
keycontrol.cpp:(.text+0x4202): undefined reference to `Time_compression_locked'
keycontrol.cpp:(.text+0x421b): undefined reference to `change_time_compression(float)'
keycontrol.cpp:(.text+0x4232): undefined reference to `Game_time_compression'
keycontrol.cpp:(.text+0x4242): undefined reference to `Time_compression_locked'
keycontrol.cpp:(.text+0x425b): undefined reference to `change_time_compression(float)'
libcode.a(keycontrol.o): In function `game_process_keys()':
keycontrol.cpp:(.text+0x5329): undefined reference to `game_poll()'
libcode.a(keycontrol.o): In function `game_do_end_mission_popup()':
keycontrol.cpp:(.text+0x32bb): undefined reference to `game_flush()'
libcode.a(readyroom.o): In function `build_campaign_mission_list_do_frame()':
readyroom.cpp:(.text+0x2e2): undefined reference to `game_find_builtin_mission(char*)'
libcode.a(readyroom.o): In function `build_standalone_mission_list_do_frame()':
readyroom.cpp:(.text+0x57a): undefined reference to `game_find_builtin_mission(char*)'
libcode.a(readyroom.o): In function `sim_room_build_listing()':
readyroom.cpp:(.text+0xe7b): undefined reference to `game_find_builtin_mission(char*)'
readyroom.cpp:(.text+0x1048): undefined reference to `game_find_builtin_mission(char*)'
libcode.a(readyroom.o): In function `readyroom_continue_campaign()':
readyroom.cpp:(.text+0x142e): undefined reference to `Game_current_mission_filename'
libcode.a(readyroom.o): In function `sim_room_commit()':
readyroom.cpp:(.text+0x151a): undefined reference to `Game_current_mission_filename'
libcode.a(readyroom.o): In function `sim_room_do_frame(float)':
readyroom.cpp:(.text+0x2610): undefined reference to `game_find_builtin_mission(char*)'
libcode.a(readyroom.o): In function `campaign_room_build_listing()':
readyroom.cpp:(.text+0x2808): undefined reference to `game_find_builtin_mission(char*)'
libcode.a(readyroom.o): In function `sim_room_init()':
readyroom.cpp:(.text+0x413a): undefined reference to `Game_current_mission_filename'
libcode.a(missiongoals.o): In function `mission_show_goals_close()':
missiongoals.cpp:(.text+0x118e): undefined reference to `game_flush()'
libcode.a(missionhotkey.o): In function `mission_hotkey_close()':
missionhotkey.cpp:(.text+0x304d): undefined reference to `game_flush()'
libcode.a(fictionviewer.o): In function `fiction_viewer_init()':
fictionviewer.cpp:(.text+0x290): undefined reference to `Fred_running'
libcode.a(fictionviewer.o): In function `mission_has_fiction()':
fictionviewer.cpp:(.text+0xa53): undefined reference to `Fred_running'
libcode.a(fictionviewer.o): In function `fiction_viewer_close()':
fictionviewer.cpp:(.text+0xb41): undefined reference to `game_flush()'
libcode.a(fictionviewer.o): In function `fiction_viewer_load(char*, char*)':
fictionviewer.cpp:(.text+0xbfe): undefined reference to `Fred_running'
fictionviewer.cpp:(.text+0xc1b): undefined reference to `Fred_running'
libcode.a(missioncmdbrief.o): In function `cmd_brief_close()':
missioncmdbrief.cpp:(.text+0xcd1): undefined reference to `game_flush()'
libcode.a(missionpause.o): In function `pause_close()':
missionpause.cpp:(.text+0x3ab): undefined reference to `game_flush()'
libcode.a(missionpause.o): In function `pause_debug_init()':
missionpause.cpp:(.text+0x49b): undefined reference to `game_single_step'
libcode.a(missionpause.o): In function `pause_debug_do()':
missionpause.cpp:(.text+0x651): undefined reference to `game_single_step'
libcode.a(missionpause.o): In function `pause_debug_close()':
missionpause.cpp:(.text+0x73b): undefined reference to `last_single_step'
missionpause.cpp:(.text+0x74d): undefined reference to `game_flush()'
libcode.a(missionscreencommon.o): In function `common_select_init()':
missionscreencommon.cpp:(.text+0x35b8): undefined reference to `Game_current_mission_filename'
libcode.a(missionscreencommon.o): In function `draw_model_rotating(int, int, int, int, int, float*, vec3d*, float, float, int, bool, int)':
missionscreencommon.cpp:(.text+0x5031): undefined reference to `flFrametime'
missionscreencommon.cpp:(.text+0x528b): undefined reference to `flFrametime'
libcode.a(modelinterp.o): In function `model_interp_get_texture(texture_info*, int)':
modelinterp.cpp:(.text+0x770d): undefined reference to `game_get_overall_frametime()'
libcode.a(modelread.o): In function `model_load_texture(polymodel*, int, char*)':
modelread.cpp:(.text+0x20e4): undefined reference to `Fred_running'
modelread.cpp:(.text+0x2111): undefined reference to `Fred_running'
modelread.cpp:(.text+0x213d): undefined reference to `Fred_running'
modelread.cpp:(.text+0x216b): undefined reference to `Fred_running'
libcode.a(modelread.o): In function `submodel_rotate(model_subsystem*, submodel_instance_info*)':
modelread.cpp:(.text+0x8f3e): undefined reference to `flFrametime'
libcode.a(modelread.o): In function `model_rotate_gun(int, model_subsystem*, matrix*, angles*, angles*, vec3d*, vec3d*, int, bool)':
modelread.cpp:(.text+0xb470): undefined reference to `flFrametime'
libcode.a(neb.o): In function `neb2_post_level_init()':
neb.cpp:(.text+0x7f0): undefined reference to `Fred_running'
libcode.a(neb.o): In function `neb2_render_player()':
neb.cpp:(.text+0x3550): undefined reference to `flFrametime'
libcode.a(neblightning.o): In function `nebl_render_all()':
neblightning.cpp:(.text+0x2a03): undefined reference to `game_flash(float, float, float)'
libcode.a(neblightning.o): In function `nebl_init()':
neblightning.cpp:(.text+0x2fd1): undefined reference to `Fred_running'
neblightning.cpp:(.text+0x3185): undefined reference to `Fred_running'
libcode.a(multi.o): In function `standalone_main_init()':
multi.cpp:(.text+0x3a0c): undefined reference to `game_hacked_data()'
multi.cpp:(.text+0x3a69): undefined reference to `game_flush()'

FSO itself compiles fine though.

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
Since I don't really have much time to throw around, I'm going to focus on re-building the project file and getting it to work under MSVC 2010. Even though I would love to learn how to use gcc and make, doing so will take up time that I simply don't have.

I've already taken out the C++11 keywords (it was just nullptr) in the 13-3-23.patch, but I'll need your help in making sure I don't make any more goofs in the .cpp and .h files that would bung up the compile process on *nix distros.

Thanks again guys. :)
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 
Re: wxFRED: March '13 Progress Report
Since I don't really have much time to throw around, I'm going to focus on re-building the project file and getting it to work under MSVC 2010. Even though I would love to learn how to use gcc and make, doing so will take up time that I simply don't have.
Too bad... but fair enough :)

Quote
I've already taken out the C++11 keywords (it was just nullptr) in the 13-3-23.patch, but I'll need your help in making sure I don't make any more goofs in the .cpp and .h files that would bung up the compile process on *nix distros.
Most of the code appears to build now, so good work so far :yes:

Looking at the 'undefined reference' error messages (see two posts up) and code/Makefile.am, it turns out that many of them originate from freespace.* and levelpaging.*, which are not included in libcode.a (presumably because they're the 'root' FSO source files) and therefore not in wxFRED. I got around it by defining a new libwxFRED in code/Makefile.am, which encompasses libcode, freespace.h, freespace.cpp, levelpaging.h and levelpaging.cpp. This of course leads to main() being defined double (for freespace as well as for wxFRED), but it as far as I can see g++ can pick the right one.

Now, though, it's still not linking back into WX properly. Looking at the linker command, it appears that the libs are entered ahead of the .o files - which leads me to suspect this issue. So I changed configure.ac:212 to put WX_LIBS in FS2_LIBS rather than FS2_LDFLAGS. That appears to do the trick.

One error remains now: an undefined reference to frmFRED2::frmFRED2(). Hmm... So should I put that in libwxFRED or directly in wxFRED_SOURCES? Educated guess: put it in wxFRED_SOURCES (since I previously removed the fredframe.* files from there, see two posts up). Hmm... Multiple WX errors compiling frmFRED2; same thing happens if I add it to libwxFRD instead. Here's the error messages:

Code: [Select]
wxfred2/frmFRED2.cpp:38:63: error: call of overloaded ‘wxString(const char [9])’ is ambiguous
candidates are:
wxString::wxString(const wxWCharBuffer&) <near match>
wxString::wxString(wxChar, size_t) <near match>
wxString::wxString(const wxString&) <near match>
wxString::wxString(int) <near match>

wxfred2/frmFRED2.cpp:43:88: error: cannot convert ‘const char*’ to ‘const wxChar* {aka const wchar_t*}’ for argument ‘2’ to ‘int wxSprintf(wxChar*, const wxChar*, ...)’

wxfred2/frmFRED2.cpp:57:37: error: ‘wxSTB_DEFAULT_STYLE’ was not declared in this scope

wxfred2/frmFRED2.cpp:59:1: error: ‘wxFRED_xpm’ was not declared in this scope

wxfred2/frmFRED2.cpp:78:36: error: invalid conversion from ‘const char*’ to ‘wxChar {aka wchar_t}’ [-fpermissive]

wxfred2/frmFRED2.cpp:78:54: error: invalid conversion from ‘const char*’ to ‘wxChar {aka wchar_t}’ [-fpermissive]

wxfred2/frmFRED2.cpp:106:138: error: conversion from ‘const char [25]’ to ‘const wxString’ is ambiguous
candidates are:
wxString::wxString(wxChar, size_t) <near match>
wxString::wxString(int) <near match>

wxfred2/frmFRED2.cpp:674:182: error: cannot convert ‘const char*’ to ‘const wxChar* {aka const wchar_t*}’ for argument ‘2’ to ‘int wxSprintf(wxChar*, const wxChar*, ...)’

It is kinda strange that these only pop up for frmFRED2.cpp, but I'm not sure whether it's the source file (what version of WX are you working with, Z? I'm on 2.8.12) or my hacking.
« Last Edit: March 23, 2013, 02:54:56 pm by FreeSpaceFreak »

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
I'm working with wxWidgets 2.9.4, which probably adds the wxString overload of wxString( const char[n] ), where n is the location of the first null terminator. It's my guess that it's actually implemented as wxString( char const * const), but I digress. :)
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 
Re: wxFRED: March '13 Progress Report
Hmm, that's probably the cause of (at least some of) the issues then - I remember similar errors when I made my modpack cleaner tool compatible with 2.8 (coming from 2.9). In my experience it is possible to support both 2.8 and 2.9 with a single codebase, but there's quite a few catches to it; deciding on a single WX version is probably more convenient.

As for which version, that's been discussed before, but without satisfying resolution. Personally, I'm in favour of 2.8, since 2.9 is still an in-dev release (and has been for a few years now, it seems). And also because most Linux repos contain 2.8, making for significantly easier installation :D
« Last Edit: March 25, 2013, 11:12:55 am by FreeSpaceFreak »

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
I'm also in favor of using wxWidgets 2.8.12... but I only have 2.9.4 set up and my dialup connection seems to be uncooperative when it comes to downloads lately. Not only is it slow, but the server keeps terminating the transfer for no apparent reason.  :banghead:

Luckily, I've figured out how to get my wireless card working again on the laptop, so I can mooch off the public library's connection soonish and will get the lib's and doc's for 2.8.12.

I might have mentioned this before, but I'll state it again. I'm currently in favor of doing static linking, because for some reason I haven't been able to get dynamic linking to work right on my machine (mainly during compile time). I am deferring the final decision on whether wxFRED should be statically or dynamically linked to when wxFRED is actually ready for the general public. Both have their pro's and con's.
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Whitelight

  • 29
  • Thing, man like
Re: wxFRED: March '13 Progress Report
Ok, tried to download wxFRED2d 13-3-10.exe, but ran into norton not playing nice. Why the heck does (norton) think this file is a threat  :nono:  I know the file is safe, but am confused.  Any imput would be appreaciated.
I`ll wait for a reply before giving it another go.
Simpicity of character is the natural resualt of profound thought

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
Ok, tried to download wxFRED2d 13-3-10.exe, but ran into norton not playing nice. Why the heck does (norton) think this file is a threat  :nono:  I know the file is safe, but am confused.  Any imput would be appreaciated.
I`ll wait for a reply before giving it another go.

Yeah, all antiviruses are like that as far as I can tell. It's mainly because it's a "rare" .exe that hasn't been tested on Norton's network, nor is it published by any well-known software publisher, and therefore presumed dangerous.

It creates a real headache whenever I try to run a test build I had *just* compiled, and my AV yells at me "UNKNOWN ORIGIN." :rolleyes:
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Whitelight

  • 29
  • Thing, man like
Re: wxFRED: March '13 Progress Report
Thanks for the reply z64555
Downloaded, and will give it a go..
Norton  :lol:
Simpicity of character is the natural resualt of profound thought

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
Uploaded the release version of the .exe a little while ago. The debug version requires .dll's that are installed whenever you have MSVC installed... so if you don't have MSVC you probably should try wxFRED2r.exe instead.
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Whitelight

  • 29
  • Thing, man like
Re: wxFRED: March '13 Progress Report
Downloaded, Thanks.
Simpicity of character is the natural resualt of profound thought

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
ShivanHunter confirmed via IRC that the provided .exe's, in fact, only work on Windows OS's. Sorry about that.  :nervous:

Hopefully by next month I'll have Debian installed on my laptop, and have some sort of cross-compiler system setup.

In other news, I've sussed out the mechanics of swapping out widgets. Possibly not the best method, but it allows developers to use widgets in wxFormBuilder as placeholders (such as wxSpinCtrl) with the intention of replacing it with the desired widget in the child class (such as wxSpinCtrlDouble).

I tried downloading wxWidgets 2.8.12 the other day, but my tired brain moved the mouse cursor over the link to 2.9.4 before clicking, and instead got a nice backup copy of 2.9.4. I'll have to wait until Monday to try again (can't do it today because of work, and the library isn't open on Saturdays and Sundays).
« Last Edit: March 29, 2013, 10:51:13 pm by z64555 »
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: wxFRED: March '13 Progress Report
Just a heads up to all followers.

I've got a major examination on the 13 (next Saturday) that determines whether or not my engineering classes sunk into my memory. It'll be the FE (Fundamentals of Engineering) exam, which will basically say "hey, I know most of my ****" to potential employers looking for an EEEN.

A side effect of this though, is that I'll be off-grid all this week and next week, so the April '13 Progress Report will have to wait until the 19'th or so.

Thanks for understanding. :)
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline redsniper

  • 211
  • Aim for the Top!
Re: wxFRED: March '13 Progress Report
Uuuuuuugggghhhhhhhhhh, man, good luck. The FE isn't particularly that hard as such, at least I didn't think so, it's just that it takes literally ALL DAY. Have fun.
"Think about nice things not unhappy things.
The future makes happy, if you make it yourself.
No war; think about happy things."   -WouterSmitssm

Hard Light Productions:
"...this conversation is pointlessly confrontational."

 
Re: wxFRED: March '13 Progress Report
Life's a matter of priorities :) Good luck on the exam!