almiteycow

Linux Project Development

122 posts in this topic

Well,

I've decided to come back, pending Apex admin's approval.

I noticed Linux development stopped, correct me if I'm wrong.

Right now, I'm working on porting Apex's Preview 3 core to LinuxDC++. GUI to be done later. It'll be a GTK application, using Glade to do the GUI. The core of Apex is done in C++. The core should be portable to Linux. If I treat them separately, just maybe something will work.

I'm no developer... So, if I'm doing something wrong, someone's going to have to let me know. If I'm going about porting it the wrong way, tell me. I'm going to try to be as open as possible with the development, that way, if anyone knows better, they can help fix it.

It's a tedious process, and I need help.

Right now, I'm attempting to do it source file by source file. LinuxDC++ will build and run on my computer, just fine. So, I'm stealing the modifications done to Apex and adding them to LinuxDC++ one file/modification at a time, then testing to see if it builds and runs. Once I get caught up to preview 3, I'll toss on the GUI modifications and then start work on porting any new changes.

As I mentioned, I need help. If you're interested in comparing code between ApexDC++ and LinuxDC++, let me know. It should be relatively easy, just takes a while.

DCTC and DC-GUI/Valknut may be helpful to look at while porting. I also suggest looking at this documentation: Ldcpp Developer information.

Basically, I need a small group of people to help me with this part of the project. If nothing else, maybe I and whoever helps will learn something new. :blushing:

...or maybe I'm crazy. :D

Share this post


Link to post
Share on other sites

Well Let me say welcome back, I had heard that you've had stopped there and well as far as I know Linux Dev sorta stopped shortly after, pm Baldar I believe he was semi working on it/ might be willing to give you a hand though I shouldn't speak for him :blushing: but you never know hehe :D Can't say I know much about porting, and my knowelege at linux is more or less a newbs knoweledge, but I have some coding practice and am trying to learn C/C++ at most I might be able to trouble shoot bugs hehe. Anyways Welcome back and I wish you luck at finding people :) I'm sure Crise and Lee will be excited to hear you're back.

Share this post


Link to post
Share on other sites

Like I've mention on IRC/hub, I might be able to help out but it depends on how advanced the code is and how it compares to my skills...

Currently I don't really have that much experience with coding, I've finished my first year of Computer Science at uni so I've done a year of C, Java and Assembly. Next year I'll be doing quite a bit of C++, and unfortunately Java, so my knowledge will be greater during/after the first semester.

I do use linux etc, as you know, but I haven't really developed anything that uses external libraries (apart from a "Hello World" GTK app :blushing:) so I'll have to learn that.

Anyway you'll probably need all the help you can get, and I like to think of myself as a quick learner :D

The LinuxDC++ devs might be able to help as well.

Share this post


Link to post
Share on other sites

Pending a Linux area for me to type this in.... Gotta keep notes for myself or my head might explode.

Progress: 5 files out of ~134

Things to check out before final release:

Major:

I don't know of an ADC hub for testing, need someone to find one and test for me.

Minor:

AdcHub.cpp has some *ahem* interesting stuff going on at the bottom of it. Code may work, may not. If someone wants to take a look at it, I'll post the source.

Figure out what's up with the names of the "Maximum & minimum file sizes (in bytes)." area of ADLSearch.h I can't get it to match Apex's code. Kibibytes are fine for now... but they bother me so.

Here's my error:
client/ADLSearch.h: In member function ‘tstring ADLSearch::SizeTypeToDisplayString(ADLSearch::SizeType)’:

client/ADLSearch.h:161: error: ‘KB’ is not a member of ‘ResourceManager’

client/ADLSearch.h:162: error: ‘MB’ is not a member of ‘ResourceManager’

client/ADLSearch.h:163: error: ‘GB’ is not a member of ‘ResourceManager’

scons: *** [build/client/ADLSearch.o]Error 1

Morale: Well as it'll be. The crew be singin' bawdy songs whilst they be workin' and the first mate be wantin' to swab the deck. Arr, mateys! :blushing:

Share this post


Link to post
Share on other sites

client/ADLSearch.h:161: error: ‘KB’ is not a member of ‘ResourceManager’

client/ADLSearch.h:162: error: ‘MB’ is not a member of ‘ResourceManager’

client/ADLSearch.h:163: error: ‘GB’ is not a member of ‘ResourceManager’

Those mean that you need to add those to StringDefs.h or equivalent (note zero knowledge of linux programming)

Share this post


Link to post
Share on other sites

Those mean that you need to add those to StringDefs.h or equivalent (note zero knowledge of linux programming)

Gotcha, easy fix. StringDefs.h seems to be StringDefs.h still.

Basically the difference between the linux c++ code and windows c++ code, is that all that stuff that just tosses warnings in windows, causes errors in linux. Or at least it seems that way.

Edited by almiteycow

Share this post


Link to post
Share on other sites

Progress: 27 files out of ~134

Working on SSL right now, in the CryptoManager.cpp file. YASSL? may be a problem.

Tomorrow, I'll see if I can find a place on the web to drop my source, so others can take a crack at certain things.

Gave up on working on porting Apex features to LDCPP. Porting Apex straight to Linux, fixing build errors and removing windows code when necessary.

Things to check out before final release:

Major:

I don't know of an ADC hub for testing, need someone to find one and test for me.

Minor:

PG support has been removed. It will need to be readded.

Removed memcpy_amd, it doesn't like linux too much. This could cause problems later though.

EDIT:

Removed webserver, will need to be readded.

Morale: Higher than the crow's nest, yarr! :)

Edited by almiteycow

Share this post


Link to post
Share on other sites

Almiteycow, you can probably use the sourceforge svn for public use, since our berlios project page is for developers only. I'll talk to Crise about arranging this.

Keep up the good work.

Share this post


Link to post
Share on other sites

http://www-128.ibm.com/developerworks/eser...2linux-sem.html

Looks like it'll fix these errors in DownloadManager.cpp:

client/SharedFileStream.h:26: error: ‘HANDLE’ does not name a type

client/SharedFileStream.h: In destructor ‘SharedFileHandle::~SharedFileHandle()’:

client/SharedFileStream.h:33: error: ‘handle’ was not declared in this scope

client/SharedFileStream.h:33: error: ‘CloseHandle’ was not declared in this scope

client/SharedFileStream.h: In member function ‘virtual size_t SharedFileStream::flush(bool)’:

client/SharedFileStream.h:60: error: ‘struct SharedFileHandle’ has no member named ‘handle’

client/SharedFileStream.h:60: error: ‘FlushFileBuffers’ was not declared in this scope

client/SharedFileStream.h:61: error: ‘GetLastError’ was not declared in this scope

client/SharedFileStream.h: In member function ‘virtual int64_t SharedFileStream::getSize()’:

client/SharedFileStream.h:70: error: ‘DWORD’ was not declared in this scope

client/SharedFileStream.h:70: error: expected `;' before ‘x’

client/SharedFileStream.h:71: error: expected `;' before ‘l’

client/SharedFileStream.h:73: error: ‘l’ was not declared in this scope

client/SharedFileStream.h:73: error: ‘INVALID_FILE_SIZE’ was not declared in this scope

client/SharedFileStream.h:73: error: ‘GetLastError’ was not declared in this scope

client/SharedFileStream.h:73: error: ‘NO_ERROR’ was not declared in this scope

client/SharedFileStream.h:76: error: ‘l’ was not declared in this scope

client/SharedFileStream.h:76: error: ‘x’ was not declared in this scope

I don't know enough C++ to understand what's going on, but I'll give it a try. If anyone can take a closer look, it'll be a big help.

Basically, it looks like the RevConnect (or wherever it's from, but that's where it seems to be) code isn't so... portable. I'm going to post up what I've got for source sometime soon, and start a contest. Whoever can port that RevConnect code first gets $50

Edited by almiteycow

Share this post


Link to post
Share on other sites

http://www-128.ibm.com/developerworks/eser...2linux-sem.html

Looks like it'll fix these errors in DownloadManager.cpp:

I don't know enough C++ to understand what's going on, but I'll give it a try. If anyone can take a closer look, it'll be a big help.

Basically, it looks like the RevConnect (or wherever it's from, but that's where it seems to be) code isn't so... portable. I'm going to post up what I've got for source sometime soon, and start a contest. Whoever can port that RevConnect code first gets $50

Just easy, you can easily run out of cash if things get more complex. :)

Share this post


Link to post
Share on other sites

http://www-128.ibm.com/developerworks/eser...2linux-sem.html

Looks like it'll fix these errors in DownloadManager.cpp:

I don't know enough C++ to understand what's going on, but I'll give it a try. If anyone can take a closer look, it'll be a big help.

Basically, it looks like the RevConnect (or wherever it's from, but that's where it seems to be) code isn't so... portable. I'm going to post up what I've got for source sometime soon, and start a contest. Whoever can port that RevConnect code first gets $50

Hmm is that what you're supposed to use on a proper POSIX system? Or is that just a "quick fix" way of porting Win32 to Linux? Edit: Guess it's what you're supposed to use since there's a Semaphore.h file in the client dir :), lots of reading that though.

How are you actually porting this? I noticed the Linux sub folder but when compiling it still uses the /client dir etc, are we supposed to just modify the files in there and get it to compile?

Might take some time to get familiar with the functions and data types... I'm bored ****less though :D

Share this post


Link to post
Share on other sites

Yeah, I don't wanna see any errors coming out of SharedFileStream.h

I'm not expecting the whole thing to compile. Yet.

EDIT: Got it myself... See Post below.

Edited by almiteycow

Share this post


Link to post
Share on other sites

Progress: (Slowly losing my mind)

Even though I may have cleared a big hurdle with that RevConnect code, I'm continuing the $50 offer to anyone who wants to/has enough skill to A) Double-check my code so far and B ) Help with difficult porting problems, such as the one in this quote/error below. Post here with what you've got.

We've got a few minor devs willing to help, which will definitely be handy while debugging the code, doing the GUI, and porting new features (and the ones I've had to remove) into future versions of Apex for Linux.

I'm going to take a few days off from this, being on holiday and all if anyone wants to continue the project in the meantime, download the file posted earlier (apologies for the slow speeds, but it's coming off my home network), and overwrite the client folder with the one attached here, if all goes well and dependencies are met, you should receive this error:

g++ -o build/client/ShareManager.o -c -pthread -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_DATADIR='"/usr/local/share"' client/ShareManager.cpp

client/ShareManager.cpp: In member function ‘void ShareManager::addDirectory(const std::string&, const std::string&)’:

client/ShareManager.cpp:427: error: ‘slist’ was not declared in this scope

client/ShareManager.cpp:427: error: expected primary-expression before ‘>’ token

client/ShareManager.cpp:427: error: ‘removeMap’ was not declared in this scope

client/ShareManager.cpp:447: error: expected primary-expression before ‘>’ token

client/ShareManager.cpp:447: error: ‘::const_iterator’ has not been declared

client/ShareManager.cpp:447: error: expected `;' before ‘i’

client/ShareManager.cpp:447: error: ‘i’ was not declared in this scope

client/ShareManager.cpp: In member function ‘void ShareManager::refresh(bool, bool, bool)’:

client/ShareManager.cpp:786: error: ‘safeExchange’ is not a member of ‘Thread’

scons: *** [build/client/ShareManager.o]Error 1

Things to check out before final release:

Major:

I don't know of an ADC hub for testing, need someone to find one and test for me.

Need someone to audit the code, is there stuff that's obviously not going to work in the code? any glaring bugs? do i just plain suck at porting?

Minor:

PG support has been removed. It will need to be readded.

Removed memcpy_amd, it doesn't like linux too much. This
could
cause problems later though.

Removed webserver, will need to be readded.

Changed RevConnect code - Will it work? Who knows?

Morale: Argh, I be sippin' on the old grog, aye, I have. :)

Oh! and ....

Have a Great Christmas/Holiday Season/Whatever! :P

Edited by almiteycow

Share this post


Link to post
Share on other sites

Progress:

Client is better, seems to be building alright, but that doesn't mean it's bugfree by any means, I know I've broken more than a few things.

Now for the GUI...

Things to check out before final release:

Major:

Need someone to audit the code, is there stuff that's obviously not going to work in the code? any glaring bugs? do i just plain suck at porting?

Minor:

PG support has been removed. It will need to be readded.

Removed memcpy_amd, it doesn't like linux too much. This
could
cause problems later though.

Removed webserver, will need to be readded.

Changed RevConnect code - Will it work? Who knows?

Morale: It be time to swab th' poop deck mateys!

Share this post


Link to post
Share on other sites

Whoever downloads and tests this, please report feedback here. It's vital for the continouation of this project.

Share this post


Link to post
Share on other sites

Lee, it won't build yet, due to the GUI stuff.

I'll see if I can port the LDCPP GUI over real quick for testing.

Edited by almiteycow

Share this post


Link to post
Share on other sites

Lee, it won't build yet, due to the GUI stuff.

I'll see if I can port the LDCPP GUI over real quick for testing.

Ah ok. Well that was for when it's compilable.

Share this post


Link to post
Share on other sites

Missed some files anyway, it seems.

Getting a new compiler error:

client/FileChunksInfo.cpp: In static member function ‘static Pointer<FileChunksInfo> FileChunksInfo::Get(const TTHValue*)’:

client/FileChunksInfo.cpp:40: error: operands to ?: have different types

Argh.. RevConnect code is driving me nuts...

To Port:

FileChunksInfo.cpp

SharedFileStream.cpp

Text.cpp?

TraceManager.cpp

Then gotta fix random linker errors.

Edited by almiteycow

Share this post


Link to post
Share on other sites

Well, after a nice little break, I've picked the project back up again. Kinda lost track of where I am, but I think I can figure it out.

Looks like I was working on fixing linker errors, like these:

/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':

(.text+0x18): undefined reference to `main'

build/client/DownloadManager.o: In function `DownloadManager::prepareFile(UserConnection*, long long, bool)':

DownloadManager.cpp:(.text+0x2afe): undefined reference to `SharedFileStream::SharedFileStream(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long long, long long, bool)'

build/client/FavoriteManager.o: In function `FavoriteManager::load(SimpleXML&)':

FavoriteManager.cpp:(.text+0x6ff9): undefined reference to `Util::fileExists(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

build/client/FileChunksInfo.o: In function `FileChunksInfo::doLastVerify(MerkleTree<TigerHash, 1024u> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':

Here's the latest source folder I'm using. Too lazy to clean it up, everything should be here, minus the dependencies.

http://almiteycow.homeip.net/pub/linuxdcpp.tar.gz

EDIT: Ah, nope, still working on porting those last 4. The scons file has 3 of them commented out.... they need to be put back in, and they throw the usual errors.

EDIT: I found this! It should make life a lot easier for me.

Edited by almiteycow

Share this post


Link to post
Share on other sites