Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 19:29

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: Help Compiling C++
PostPosted: 22 Dec 2007 18:02 

Joined: 15 Dec 2007 02:52
Posts: 2
Hi Luigi. I am trying to compile one of your proof of concepts and Im using Visual C++ Express Addition and I can't get it to compile It just comes back with tons of errors. Any help would be appreciated.


Top
 Profile  
 
 
 Post subject:
PostPosted: 22 Dec 2007 18:14 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
you could have some problems using that compiler (here I use mingw/gcc), anyway the first thing you must try is what is written here:

http://aluigi.altervista.org/about.htm#compile

if you are lucky everything will compile perfectly and at least you will have less errors on which working or to post here


Top
 Profile  
 
 Post subject:
PostPosted: 23 Dec 2007 05:15 

Joined: 24 Sep 2007 02:12
Posts: 1114
Location: http://sethioz.co.uk
btw i tried mingw before with same options .. but still got some errors. i will post what i did and what i got later..


Top
 Profile  
 
 Post subject:
PostPosted: 23 Dec 2007 05:27 

Joined: 24 Sep 2007 02:12
Posts: 1114
Location: http://sethioz.co.uk
did quick test with flashchatz...
thats what i got..i think somethings wrong with my win settings ?


Attachments:
blah1.JPG
blah1.JPG [ 94.25 KiB | Viewed 824 times ]
Top
 Profile  
 
 Post subject:
PostPosted: 23 Dec 2007 11:30 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
add the following to the gcc command-line and it will work:

mydownlib.c stristr.o -lz


Top
 Profile  
 
 Post subject:
PostPosted: 23 Dec 2007 17:25 

Joined: 24 Sep 2007 02:12
Posts: 1114
Location: http://sethioz.co.uk
this thing really starts to annoy me ... and you probably rolling your eyes by now lol.
now i remember where it started .. i was trying to compile netcat. ..it gave me similiar errors.
hope you can help me out ...


Attachments:
argh1.JPG
argh1.JPG [ 97.53 KiB | Viewed 816 times ]
Top
 Profile  
 
 Post subject:
PostPosted: 23 Dec 2007 20:14 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
you have left -lws2_32 out


Top
 Profile  
 
 Post subject:
PostPosted: 24 Dec 2007 17:09 

Joined: 24 Sep 2007 02:12
Posts: 1114
Location: http://sethioz.co.uk
no i did not .. its after the flashchatz.c .. -lws2_32 .. right there.
its on the screenie :O
i did other test too ..


Attachments:
blah111.JPG
blah111.JPG [ 26.2 KiB | Viewed 801 times ]
Top
 Profile  
 
 Post subject:
PostPosted: 24 Dec 2007 19:14 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
ok try to substituite stristr.o with stristr.c (the original source file).

That error is very strange, I have searched on internet and the only most interesting page (only few were found) is the following:

http://www.cygwin.com/ml/cygwin/2000-06/msg01108.html

For the next times instead of posting the image you can simply copy and paste the content of the console window using [quote] paste_here [/quote] in the message (remember to remote "Disable BBCode in this post" in the Options of the message)


Top
 Profile  
 
 Post subject:
PostPosted: 25 Dec 2007 11:38 

Joined: 24 Sep 2007 02:12
Posts: 1114
Location: http://sethioz.co.uk
thanks for that, it compiled now...
i did...
Code:
gcc -o flashchatz.exe flashchatz.c mydownlib.c stristr.c -lz -lws2_32

..but when i try to run flashchatz .. it says ''this app has failed to start because zlib1.dll was not found. re-installing the app may fix this problem''
oviously something went wrong .. cuz it doesnt need any dll, right ?

edit:
file size is also not same. its 46.4kb but it should be 47.0kb

edit again:
it also compiles with ''flashchatz'' instead of ''flashchatz.exe''

update:
very wierd...i downloaded ''zlib1.dll'' and put it into the /bin folder (where the .exe is atm) and it works...but its NOT the same as the one you compiled.


Top
 Profile  
 
 Post subject:
PostPosted: 25 Dec 2007 14:09 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
About zlib1.dll it's all normal, in short exist two ways to implement libraries:

- statically, the library is included directly in the executable.
pro: portability and usage
con: you must recompile the whole stuff if a new version of the library is released

- dynamically as shared library, the classical dll
pro: smaller size of the executable and avoids redundant code (100 programs which use zlib as static have the same code repeated 100 times, while in shared more only one time)
con: you must be sure that the other people have the needed dll and in some cases just a specific version of the dll

I prefer the static mode for my tools so the people which use the included pre-compiled executable don't need to bore finding additional stuff and I don't need to included (for example) zlib1.dll in all my packages which use zlib.

If you watch in your mingw\lib directory you will find some *libz* files.
Try to leave there only libz.a and rename or place in a temporary folder all the others *libz*.

If you want smaller executables add -s to gcc


Top
 Profile  
 
 Post subject:
PostPosted: 25 Dec 2007 15:17 

Joined: 24 Sep 2007 02:12
Posts: 1114
Location: http://sethioz.co.uk
thanks. now it works.
i removed ''libz.dll.a'' (only other libz file) from the /lib folder.
now i have only ''libz.a'' in the /lib folder and it compiles well. program works without any .dll files


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron