Author Topic: N00b here! I want to help.  (Read 8626 times)

GwynWynn

  • User
  • *
  • Posts: 10
N00b here! I want to help.
« on: February 11, 2008, 09:23:18 PM »
I must begin with some background information:
I began coding in BASIC (Commodore Vic-20), mostly hobby books copying code to a tape drive. I have coded a few small applications, text only console, in C++. I have done a small amount of network programming in Java. I do most of my work on WinXP running on an older AMD chip (3000+ 32 bit). I have also worked with Slackware Linux. I run a FreeBSD box with Neverwinter Nights running a custom module, the server name is "Questworld_Tharbanm" (I wrote most of the custom scripts. My son wrote the rest.) I have an associates degree with a technical specialty of Computer Application Developer from Tacoma Community College.

Goals:
I want to gain an in-depth understanding of multi-threaded network programming.
I want to contribute to a community project while I learn.
I want to assemble a team and develop a MMORPG space exploration and conquest game (this part may take a while.)

GNE work to date:
I installed and configured MinGW and MSYS. (tested the configuration with a Hello World)
I compiled and installed HawkNL 1.68 (tested the install with some of the sample code provided)
I copied the Boost 1.34.1 Library into C:\MinGW\Boost_1_34_1 (I did not test this lib at this point)
I unpacked GNE into my MinGW directory.
I added the Boost Directory to the LibPaths.mak file and commented out the Hawk lines.
I added my INCDIR and LIBDIR paths to the make file. figured this out after make failed on my first attempt.
I compiled and installed GNE 0.70 (no errors reported.)
I tried to compile exhello.cpp and the compiler spat errors about "GNE not a namespace."
I looked into my MinGW directory and found a strange directory "installgnelib"
I uninstalled GNE (the make uninstall seemed to work.)
I opened the make file and changed some lines by adding a / in front of gnelib. here is the content of my current GNE makefile.

//modified makefile begin.
all: makefile.os lib examples

.PHONY: all lib examples install clean veryclean uninstall

makefile.os:
   @echo Run one of the fix* scripts to set up the makefile to your OS.

include LibPaths.mak
include makefile.os

lib: $(LIB_STATIC)

examples: $(EXAMPLES_DIR) lib $(EXAMPLE_EXE)

$(LIB_STATIC): $(LIB_O)
   $(AR) rs $@ $^

$(LIB_CPP_O): %.o: %.cpp
   $(CPP) -c -o $@ -MMD $(CPPFLAGS) $<

$(LIB_C_O): %.o: %.c
   $(CC) -c -o $@ -MMD $(CFLAGS) $<

$(EXAMPLE_EXE): $(EXE_MASK): $(EXAMPLE_DIR) %.o $(LIB_STATIC)
   $(CPP) -o $@ $(LDFLAGS) $< $(EXAMPLE_LIBS)

$(EXAMPLE_O): %.o: %.cpp
   $(CPP) -c -o $@ $(CPPFLAGS) $<

-include $(DEPENDENCIES)

ifdef EXAMPLES_DIR

$(EXAMPLES_DIR):
   $(MKDIR) $@

endif

#added the include and lib paths
INCDIR=/mingw/include
LIBDIR=/mingw/lib

clean:
   $(RM) $(EXAMPLE_O) $(LIB_O) $(DEPENDENCIES)

veryclean: clean
   $(RM) makefile.os $(EXAMPLE_EXE) $(LIB_STATIC)

install: $(LIB_STATIC)
   $(CP) $< $(LIBDIR)
   $(CP) include/gnelib.h $(INCDIR)
   -$(MKDIR) $(INCDIR)/gnelib                     #-$(MKDIR) $(INCDIR)gnelib
   $(CP) include/gnelib/*.h $(INCDIR)/gnelib #$(CP) include/gnelib/*.h $(INCDIR)gnelib

uninstall:
   $(RM) $(LIBDIR)$(LIB_STATIC_NAME)
   $(RM) $(INCDIR)/gnelib.h    #$(RM) $(INCDIR)gnelib.h
   $(RM) $(INCDIR)/gnelib/*    #$(RM) $(INCDIR)gnelib/*
   $(RMDIR) $(INCDIR)/gnelib  #$(RMDIR) $(INCDIR)gnelib
//modified makefile end

I tried to compile the exhello example again. This time I get undefined reference errors on GNE::Console::* (replace * with every function name used in exhello.cpp)

Is there an option that I forgot? I have the .o file from the initial compilation of the lib.
I have studied the tutorial, and I think I understand it. However, I have been known to make mistakes, from time to time.

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
Re: N00b here! I want to help.
« Reply #1 on: February 12, 2008, 12:07:49 AM »
You know, when I last worked on GNE I last stopped right before release. I actually almost forgot that the old GNE 0.70 that is public is Makefile-based and I'm surprised I didn't push myself harder. The old build system was built on makefiles and command line scripts for Windows, and it was 5 years ago and I don't even remember how it works.

If you are interested in helping, if you could, could you get the latest version from SVN and try out the new CMake build system? I would have to look into the documentation there and see if I did update that documentation. From what I can see, I have updated readme.windows for the new system.

I'm curious to know what I actually left myself to do before release. The big goal I had in coming back to this was to make it a lot easier to build and work with, and make packages for it in other OS like Ubuntu. I even have a libgne.spec file that someone contributed via e-mail in March 2007 that I've been waiting to integrate, but I've never done any work with RPM before. I think GNE's been basically ready for another release for awhile but, ironically the biggest obstacle is that it's been so long since I've worked on it that not knowing what I had to clean up for release is holding that up.
Gillius
Gillius's Programming http://www.gillius.org/

GwynWynn

  • User
  • *
  • Posts: 10
Re: N00b here! I want to help.
« Reply #2 on: February 13, 2008, 12:42:15 AM »
It took a bit of work but I got the SVN linked and GNE is installed.

I installed Cmake and the pre-compiled Win Binary for TortoiseSVN, and doxygen.
I then Configured the GNE SVN and used Cmake to config for MinGW.
Once I got the library locations right, this took some trial and error, I learned not to specify the boost directory itself instead I had to name the directory that contained the boost directory e.g. I have boost installed at c:\mingw\boost_1_34_1. The first time I set the boost path in Cmake I called out "c:\mingw\boost_1_34_1\boost" this is, as I found out, one directory too deep. All I had to do is reconfig Cmake to call out "c:\mingw\boost_1_34_1" and everything went smoothly from there on out.
I installed GNE into my MinGW /include and /lib directories for convenience.

Please note that in the readme.windows file I made an error. I followed the commands literally.
I typed in mingw32-make to build
I typed make install (oops) msys crashed out to windows cmd.
I typed mingw32-make install and the files were copied correctly.
here is an excerpt of the readme.windows file that caught me off guard
// begin clip
2.3 Installation -- MinGW

Using mingw32-make.exe, build the generated makefiles.

If you want to install, run:

make install

You can also prepend th...
// end clip

Now, it is late here and I must go to bed. I will post again once I have tested the install by compiling some examples. I will be following through the doxygen pages that built with GNE. ( that is sooooo cool! it looks cleaner than the Javadoc tool from sun.)

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
Re: N00b here! I want to help.
« Reply #3 on: February 13, 2008, 09:51:05 PM »
Yeah, I'm a MSVC user and not so much MinGW. If you could give me some information on this... MinGW used to supply "make" but somewhere along the way the developers decided to rename it as "mingw32-make". From my understanding it was to reduce conflicts with cygwin make or something else. But I can't remember if it always installs that way now or if it gives you the option. Does MinGW put mingw32-make on your path by default?

It looks like I actually copied that section from the Linux side.

Besides changing "make" to "mingw32-make", is there any other wording I can change there to make it easier for users, like do I need to say "make sure it is in your path" or "execute C:\mingw32\bin\mingw32-make or wherever you have installed it" ?
Gillius
Gillius's Programming http://www.gillius.org/

GwynWynn

  • User
  • *
  • Posts: 10
Re: N00b here! I want to help.
« Reply #4 on: February 15, 2008, 01:14:02 AM »
Since I am using MSYS as my shell I am working in a POSIX-like environment. The command structure is very much like the Linux and BSD sh terminal. In MinGW the make command still exists but it is somehow different from mingw32-make, I am a little fuzzy on the particulars there.

As for MSVC, I haven't used it since they first introduced us to .NET in college.

>>Gillius ' do I need to say "make sure it is in your path" or "execute C:\mingw32\bin\mingw32-make or wherever you have installed it"'
I am not sure that level of detail is necessary. Also, if MSYS is installed after MinGW the path can be optionally included in the configuration.

I am also new to the GNU compiler set, I worked on Borland 5.5 command line tools for most of the C++ I have written. Therefore, I have to give myself a crash course in gnu command line options. When I get g++ figured out I will get back to compiling the examples. It this point I may be in over my head so I must move to the shallows till I can tread water.

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
Re: N00b here! I want to help.
« Reply #5 on: February 15, 2008, 08:06:39 AM »
Well, you compile the examples with CMake just as you did the library, no knowledge of GCC is necessary. Were you able to follow the instructions in the readme to do that? Basically it says to set the CMake parameter for compiling examples to "ON".

Or are you wanting to compile them by hand to see how to work GNE?
Gillius
Gillius's Programming http://www.gillius.org/

ShotgunNinja

  • User
  • *
  • Posts: 4
Re: N00b here! I want to help.
« Reply #6 on: February 15, 2008, 04:39:13 PM »
Wow. A college graduate and primary Linux coder who forgot to Read The Fantastic Manual?  :o

GwynWynn

  • User
  • *
  • Posts: 10
Re: N00b here! I want to help.
« Reply #7 on: February 15, 2008, 08:36:24 PM »
How rude is that? Imagine in our ME ME ME society a man is humble enough to say he jumped the gun, and he gets a prompt smack down from another citizen with nothing useful to say. I forgive you Shotgun Ninja. I understand you have your own way of expressing yourself, and that is all right with me as long as we are all free to do the same.

Cheers friend.

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
Re: N00b here! I want to help.
« Reply #8 on: February 15, 2008, 11:45:51 PM »
Hey guys, we've only got 3 people active on the forums right now let's not get carried away.

Anyway, GwynWynn, I couldn't tell if you were trying to compile the examples directly with gcc or weren't successful with CMake. Let me know if you have any problems or any suggestions on how to make anything easier in the compile.

I want to thank you since having someone go over the process and give feedback is helpful as it's hard for me to tell if my documentation is readable to someone who is new to the project.
Gillius
Gillius's Programming http://www.gillius.org/

GwynWynn

  • User
  • *
  • Posts: 10
Re: N00b here! I want to help.
« Reply #9 on: February 16, 2008, 02:15:58 PM »
I was trying to compile only some of the examples. I was using an incremental approach, I tried to use Cmake on the exhello example and found that it is not configured for for Cmake by itself. So I then tried to use the command line gpp/g++ and got a bit confused on how to setup the lib switches.

Since I did not make the examples on the first run, I gather I have to Cmake everything, or figure out how to setup the command line and then make a Cmake List for each example. I am interested in learning Cmake and gpp command structures anyway so I will try the latter first. If I get too frustrated, I will remake all the files.

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
Re: N00b here! I want to help.
« Reply #10 on: February 16, 2008, 05:16:14 PM »
The way that the CMake is set up you need to compile all of the examples at once. I think the only limitation why this is so is because the main file at the gnelib root sets everything up, and the examples work off of that. You could parameterize the file to only build some examples, but that might be too much work. I'm not sure quite how to modify it to allow compiling only specific examples by running CMake in their directories as when I was learning it I was focused on the monolithic approach.

If you figure out how to adjust the CMake or just want to contribute instructions to manually compile a specific example, pass it along and I can integrate it into my code.
Gillius
Gillius's Programming http://www.gillius.org/

GwynWynn

  • User
  • *
  • Posts: 10
Re: N00b here! I want to help.
« Reply #11 on: February 19, 2008, 01:13:04 AM »
I ran into a small problem. I have tried three different approaches and the examples have not compiled. The latest attempt (I got frustrated) was with CMake and the entire GNE system compiled from the trunk. I set the options as before and changed the Examples switch to ON. All the GNE main code compiled normally as before; however, the exadder code failed to compile and the make system halted and returned me to the prompt after spitting out a bunch of errors regarding "multiple definitions of _onexit" and continued on with many "undefined references." I am not sure how many of the errors are cascade effects of the "multiple definitions" errors (_onexit and atexit).

Now I am confused, any help would be appreciated.