--- Log opened Sun Feb 24 00:00:02 2008 |
00:00 | <@gnolam> | Because MSYS is a piece of shoddy software engineering and will conflict with other existing makes. :P |
00:01 | <@ToxicFrog> | Ok. |
00:01 | <@ToxicFrog> | As for actually using g++... |
00:02 | <@ToxicFrog> | For a straight compile-and-link, it's just g++ <options> -o foo.exe <list of cpp files> <libraries> |
00:03 | <@ToxicFrog> | libraries are in -lfoo form; eg, to use libfoo.a or foo.dll, you would use '-lfoo' (or '-l foo') as the option. |
00:03 | <@gnolam> | (Well, the order is actually pretty optional) |
00:03 | <@ToxicFrog> | (no it isn't, actually) |
00:03 | <@ToxicFrog> | (in particular, the order of libraries relative to object and source files is very significant) |
00:03 | <@gnolam> | (The order of libraries, yes. But not the g++ command line.) |
00:03 | <@ToxicFrog> | options are...well, there's lots of them, but the ones you'll be most interested in: |
00:03 | <@McMartin> | (Depends on the version of gcc) |
00:03 | <@gnolam> | (That GCC requires a particular library order is a pet peeve of mine, BTW.) |
00:04 | <@gnolam> | (And why are we all still whispering?) |
00:04 | <@Vornicus> | (nobody's popped yet) |
00:04 | <@McMartin> | (To not interrupt) |
00:04 | <@ToxicFrog> | -g (build debugging information); -O0 (capital O zero, no optimization); -O2 (optimize more); -Os (optimize for size); -Wall (enable all warning messages) |
00:04 | <@ToxicFrog> | Typically you'll want -Wall always, -g -O0 for testing and -O2 (without -g or -O0!) for release builds. |
00:05 | <@gnolam> | -Osomethingotherthanzero actually makes it spit out a few more warnings, so it's usually good to just leave it on -O2. |
00:05 | <@ToxicFrog> | gnolam: makes it harder to actually debug, though. |
00:06 | <@AnnoDomini> | Will g++ find the libraries corresponding to the .h files I #include in the code? |
00:06 | <@ToxicFrog> | AnnoDomini: no, that's what the -lfoo options are for. |
00:06 | <@gnolam> | Excluding the standard libraries, no. |
00:06 | <@AnnoDomini> | Define standard? |
00:06 | <@Vornicus> | the C standard libraries |
00:06 | <@ToxicFrog> | "the set of libraries automatically part of any C and/or C++ program" |
00:06 | <@AnnoDomini> | So pretty much nothing. |
00:07 | <@ToxicFrog> | ... |
00:07 | <@McMartin> | These days -O1 -g is workable. |
00:07 | | * AnnoDomini is confused. |
00:07 | <@ToxicFrog> | Well, nothing apart from the STL, iostream and friends, <cstdio> and all the other <csomething> includes... |
00:07 | <@McMartin> | AnnoDomini: Anything but math.h that gets the <> includes is in by default. |
00:07 | <@McMartin> | Stuff in math.h will require -lm |
00:07 | <@AnnoDomini> | Oh. |
00:08 | <@ToxicFrog> | McMartin: ...except that typically, you install system-wide dev libraries so that you can <include> them |
00:08 | <@gnolam> | It will? That's news to me. |
00:08 | <@McMartin> | gnolam: Oh yes. |
00:08 | <@ToxicFrog> | I can #include <curses.h>, but that won't automatically link against libcurses. |
00:08 | <@gnolam> | I've never had to include it. Not here, not on the Solaris boxen at Uni. |
00:08 | <@McMartin> | gnolam: I've failed to find atan2 more times than I can count. |
00:08 | <@gnolam> | (And that's "include it on the command line", not "#include it") |
00:08 | <@ToxicFrog> | Likewise. |
00:09 | <@ToxicFrog> | I've never tried it on solaris, but on both mingw and linux you need -lm. |
00:09 | <@gnolam> | Not with any MinGW I've used. And I've used atan2 extensively. :P |
00:10 | <@gnolam> | Could be a GCC/G++ thing though. Most of my code has traditionally been in C. |
00:10 | <@gnolam> | GCC is fond of quirks like that. :P |
00:10 | <@McMartin> | Doesn't work on stock C. |
00:11 | <@McMartin> | On Ubuntu. |
00:11 | | * gnolam makes a quick test. |
00:11 | <@gnolam> | Nope. |
00:12 | <@ToxicFrog> | Are you sure you don't have your specfiles set up to automatically -lm or something? |
00:12 | <@ToxicFrog> | AnnoDomini: anyway. That's for compiling and linking in one step. |
00:12 | <@ToxicFrog> | For compiling to object files, and then linking seperately: |
00:12 | <@gnolam> | Nope. Stock MinGW. |
00:12 | <@ToxicFrog> | g++ -c <options> -o foo.o foo.cpp |
00:12 | <@ToxicFrog> | (the -c is "compile only, do not link") |
00:12 | <@ToxicFrog> | g++ <options> -o foo.exe <list of object files> <libraries> |
00:13 | <@McMartin> | Er. Libraries go *first* |
00:13 | <@ToxicFrog> | ...since when? |
00:13 | <@McMartin> | ... since they broke the shit out of all my SDL stuff. |
00:13 | <@McMartin> | when I didn't, I mean |
00:13 | <@ToxicFrog> | I always put the the libraries last. |
00:13 | <@McMartin> | I think. |
00:14 | <@ToxicFrog> | And have never had any problems doing so. |
00:14 | <@McMartin> | Hm. *one* will break occasionally. I should check Sable's build files. |
00:14 | <@ToxicFrog> | Or, well, never any problems related to library ordering. |
00:14 | <@gnolam> | As I said before, IMO the ordering of the GCC command line is optional. |
00:15 | <@ToxicFrog> | Since the man page explicitly says that the ordering is significant, and since changing the ordering can and does change the behaviour of the program, including being the difference between compiling and not compiling, I submit that you are incorrect. |
00:31 | <@AnnoDomini> | Hm. Okay, it compiles and links. But when I try running it, it says it can't run the application, because pdcurses.dll is missing. |
00:31 | | * AnnoDomini is mystified. |
00:35 | <@AnnoDomini> | Shouldn't whatever's needed be included in the .exe or something? |
00:35 | <@ToxicFrog> | Only with static linking. |
00:36 | <@ToxicFrog> | A .a or .lib is statically linked - the contents of the library are built directly into the program. |
00:36 | <@ToxicFrog> | A .dll or .so is dynamically linked - it is loaded when the program is run. |
00:36 | <@ToxicFrog> | Make sure the DLL is in the same directory as the exe, or is in your PATH. |
00:37 | <@AnnoDomini> | So putting pdcurses.dll in the program directory should solve the problem. Can one select what is dynamically and what is statically linkeD? |
00:37 | <@AnnoDomini> | *linked |
00:39 | <@ToxicFrog> | gcc will by default dynamically link where possible, and statically link only if it can't find a dynamic library. |
00:39 | <@ToxicFrog> | You can force it to statically link everything with the -static flag. |
00:39 | <@ToxicFrog> | Note that this requires static libraries; you can't use -static if all you have to link against is a DLL. |
00:40 | <@ToxicFrog> | As a general rule, dynamic linking is preferred. |
00:40 | <@AnnoDomini> | Not that I have something against, but why? |
00:42 | <@ToxicFrog> | It lets you replace a program's libraries without recompiling the program. Also - on windows at least - it avoids some serious with shared sublibraries (eg, you have a program that uses libfoo, and that program uses bar.dll which also uses libfoo) |
00:42 | <@ToxicFrog> | *serious issues |
00:51 | | Attilla [~The.Attil@194.72.70.ns-11849] has quit [Ping Timeout] |
00:52 | | * AnnoDomini goes to sleep now. |
00:52 | | AnnoDomini [AnnoDomini@83.21.33.ns-25552] has quit [Quit: Quem quer o garfo?] |
00:55 | | Attilla [~The.Attil@194.72.70.ns-11849] has joined #code |
01:52 | | * Vornicus decides he should probbly unsub from these lists, he never reads them. |
02:38 | | gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?] |
03:12 | | Vornicus is now known as Vornicus-Latens |
03:40 | | Simone is now known as Jennet |
03:54 | <@McMartin> | Has anyone here ever played with the Google Web Toolkit? |
04:08 | <@McMartin> | Also rrgh. TextWrangler's Documents Drawer is misbehaving. |
04:12 | | Jennet is now known as Nero`s_Neptune |
04:38 | <@McMartin> | http://www.stanford.edu/~mcmartin/misc/uqm_resources.png |
04:38 | <@McMartin> | Go forth, my army of robots, etc. |
05:51 | | GeekSoldier|bed [~Rob@Nightstar-9164.dip.t-dialin.net] has quit [Ping Timeout] |
06:39 | | GeekSoldier|bed [~Rob@Nightstar-8328.dip.t-dialin.net] has joined #code |
07:00 | | Thaqui [~Thaqui@Nightstar-123.jetstream.xtra.co.nz] has joined #code |
07:01 | | mode/#code [+o Thaqui] by ChanServ |
07:14 | | GeekSoldier|bed is now known as GeekSoldier |
08:42 | | C_tiger [~c_wyz@96.232.26.ns-11798] has quit [Connection reset by peer] |
08:44 | | C_tiger [~c_wyz@96.232.26.ns-11798] has joined #code |
09:14 | | AnnoDomini [AnnoDomini@83.21.33.ns-25552] has joined #Code |
09:14 | | mode/#code [+o AnnoDomini] by ChanServ |
09:16 | | You're now known as TheWatcher |
09:41 | | gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code |
09:41 | | mode/#code [+o gnolam] by ChanServ |
10:43 | | Thaqui [~Thaqui@Nightstar-123.jetstream.xtra.co.nz] has left #code [Leaving] |
12:59 | | Vornicus-Latens is now known as Vornicus |
13:02 | | AnnoDomini [AnnoDomini@83.21.33.ns-25552] has quit [Ping Timeout] |
13:09 | | AnnoDomini [AnnoDomini@83.21.33.ns-26073] has joined #Code |
13:09 | | mode/#code [+o AnnoDomini] by ChanServ |
15:20 | | Vornicus [~vorn@Admin.Nightstar.Net] has quit [Ping Timeout] |
15:23 | | Vornicus [~vorn@Admin.Nightstar.Net] has joined #code |
15:23 | | mode/#code [+o Vornicus] by ChanServ |
16:10 | | Vornicus [~vorn@Admin.Nightstar.Net] has quit [Ping Timeout] |
16:10 | | Vornotron [~vorn@Admin.Nightstar.Net] has joined #code |
16:10 | | Vornotron is now known as Vornicus |
17:01 | | * GeekSoldier stabs SWT until it does what he wants it to. |
17:01 | < GeekSoldier> | I may be here for a while... |
17:03 | | CL0wn4heLL [~TrOuBLeX@83.32.12.ns-26115] has joined #Code |
17:04 | <@ToxicFrog> | Aah, SWT. |
17:04 | <@ToxicFrog> | For when you just aren't insane enough yet. |
17:05 | < GeekSoldier> | indeed. |
17:05 | <@ToxicFrog> | Coursework? |
17:05 | < GeekSoldier> | unfortunately. |
17:09 | | You're now known as TheWatcher[afk] |
17:10 | < GeekSoldier> | specifically, I'm trying to line up a combobox below a check box below a textbox... for some reason, the checkbox and combobox occupy the same location. |
17:21 | | CL0wn4heLL [~TrOuBLeX@83.32.12.ns-26115] has quit [Quit: ] |
17:28 | | * GeekSoldier realizes his problem... hangs his head in shame. |
17:31 | <@ToxicFrog> | Hooray for duck typing |
17:31 | | * ToxicFrog writes a function to turn a string into something that looks very much like a file |
17:34 | < Vornicus> | hooray |
17:40 | <@ToxicFrog> | ;.; |
17:40 | <@ToxicFrog> | The original unit tests: true true true true true |
17:40 | <@ToxicFrog> | After moving it into its own module: true false true crash |
17:41 | < Vornicus> | ;_; |
17:42 | <@ToxicFrog> | Oh, there's the problem. |
17:42 | <@ToxicFrog> | In moving it I changed make_cursor from a standalone function into a __call metamethod on the module itself. |
17:42 | <@ToxicFrog> | Which changes the argument signature. |
17:43 | <@ToxicFrog> | I did not, however, update the function to reflect this ?? |
17:45 | <@ToxicFrog> | Now comes the hard part: writing the actual pack/unpack code. |
18:19 | | You're now known as TheWatcher |
19:09 | | Syloq [Syloq@NetAdmin.Nightstar.Net] has joined #code |
19:10 | | Syloq is now known as Syloqs-AFH |
19:32 | | GeekSoldier is now known as GeekSoldier|bed |
19:54 | <@AnnoDomini> | Does anybody know of any quirks that might prevent TASM from being able to find files with correct paths to them? |
19:54 | <@AnnoDomini> | This is WinXPSP2. |
19:56 | <@ToxicFrog> | Failure to correctly escape \ in paths? |
19:56 | <@ToxicFrog> | Never used TASM, though, so I'm just guessing. |
19:57 | <@AnnoDomini> | "Escape \"? |
19:57 | <@ToxicFrog> | Well, how are you passing these paths into it? |
19:58 | <@ToxicFrog> | Many shells and programs (although cmd.exe is not one of them) treat \ specially |
19:58 | <@AnnoDomini> | "C:\Tasm_5\BIN\tasm.exe C:\Tasm_5\asm\helloworld.asm" |
19:58 | <@ToxicFrog> | It is commonly used as an escape character, to either remove special meaning from a character, or insert otherwise intypeable characters. |
19:58 | <@ToxicFrog> | Is this in cmd.exe? |
19:59 | <@ToxicFrog> | If so, then that probably isn't the problem, although using / is a good habit to get into in any case. |
19:59 | <@AnnoDomini> | I put this in a batch file. |
20:00 | <@ToxicFrog> | Which is equivalent. |
20:00 | <@ToxicFrog> | What's the exact error message it gives? |
20:00 | <@AnnoDomini> | **Fatal** Command line: Can't locate file: C:\Tasm_5\asm\helloworld.asm |
20:02 | <@ToxicFrog> | Weirdness. |
20:02 | <@ToxicFrog> | ...what does happen if you try it with /? The same thing? |
20:05 | <@AnnoDomini> | Fatal, invalid target. |
20:05 | <@ToxicFrog> | Flarghl |
20:06 | <@ToxicFrog> | What happens if you cd into c:/tasm_5/asm and ../bin/tasm.exe helloworld.exe ? |
20:06 | <@AnnoDomini> | I'll try that in a moment. |
20:08 | <@AnnoDomini> | **Fatal** Command line: Can't locate file: helloworld.exe |
20:08 | <@ToxicFrog> | Er |
20:08 | <@ToxicFrog> | helloworld.asm |
20:08 | <@AnnoDomini> | **Fatal** Command line: Can't locate file: helloworld.asm |
20:10 | <@ToxicFrog> | But "dir" shows helloworld.asm in the current directory? |
20:11 | <@AnnoDomini> | It's there, alright. |
20:11 | <@ToxicFrog> | I've got nothing, then. |
20:11 | <@AnnoDomini> | The linker somehow finds the file, and even generates a MAP file for it. |
20:11 | <@AnnoDomini> | But can't do anything without an OBJ. |
20:11 | <@ToxicFrog> | msdev ;.; |
20:12 | <@ToxicFrog> | Aah well. Shower time. |
20:36 | <@ToxicFrog> | Vornicus, McMartin: I need libstruct interface advice and algorithm review. |
20:36 | <@ToxicFrog> | In particular, what letter should I use for fixed-point? |
20:36 | <@ToxicFrog> | And am I correct in thinking that I can implement fixed-point read as signed integer read, then divide by 2^(number of bits of fractional part)? |
21:08 | | Nero`s_Neptune is now known as Julia |
21:13 | <@AnnoDomini> | ToxicFrog: Do you perchance know of any other ebook-offering networks? The seekbot's back online, but it didn't find what I wanted. |
21:13 | | mode/#code [+ooooo Attilla C_tiger GeekSoldier|bed Syloqs-AFH Vornicus] by AnnoDomini |
21:13 | <@Vornicus> | TF: you'd be right, I think |
21:18 | <@ToxicFrog> | AnnoDomini: afraid not. |
21:18 | <@ToxicFrog> | Vornicus: excellent. Any thoughts on character? |
21:18 | <@ToxicFrog> | I'm figuring either p (fixed point), r (rational), or just overloading f so that 'f4' is a float, 'f8' is a double, and 'f3.1' is a 24.8 fixed point. |
21:19 | <@Vornicus> | I'll say p. |
21:24 | <@ToxicFrog> | function read.p(fd, w) |
21:24 | <@ToxicFrog> | local d,f = string.split(w, '%.') |
21:24 | <@ToxicFrog> | return read.u(fd, d+f)/(2^(f*8)) |
21:24 | <@ToxicFrog> | end |
21:25 | | * ToxicFrog ticks off "fixed point rational" support on the feature list |
21:25 | <@ToxicFrog> | All that's left for read support is null-terminated strings, floats, and unsigned ints. |
21:25 | <@ToxicFrog> | Of course, I still need the parser for the format strings~ |
21:29 | <@ToxicFrog> | <3 regexes that support NUL |
21:42 | <@McMartin> | p is used by printf for pointers, just as a note |
22:07 | | Vornicus [~vorn@ServicesOp.Nightstar.Net] has quit [Ping Timeout] |
22:09 | | Vornicus [~vorn@Admin.Nightstar.Net] has joined #code |
22:09 | | mode/#code [+o Vornicus] by ChanServ |
22:33 | | Vornicus is now known as Finerty |
22:36 | <@ToxicFrog> | Compatibility with printf is already broken and I can think of no situation where having a "pointer" pack/unpack format is a good idea, so. |
22:47 | <@MyCatVerbs> | ToxicFrog: still would be nice to not confuse people. |
22:47 | <@gnolam> | What exactly are you doing? |
22:48 | <@MyCatVerbs> | ToxicFrog: even if code isn't necessarily portable between two vaguely similar things, it's still nice to keep peoples', ah, intuitions portable. So to speak. |
22:53 | <@ToxicFrog> | MyCatVerbs: suggest a character for skip/pad other than 'x' that doesn't conflict with an existing printf format, then. |
22:53 | <@ToxicFrog> | gnolam: libstruct. |
22:54 | <@ToxicFrog> | A library for packing and unpacking arbitrary binary formats. |
22:54 | <@gnolam> | ? |
22:54 | <@gnolam> | Ah. |
22:54 | <@McMartin> | TF: "." |
22:54 | <@ToxicFrog> | Inspired by the Python struct function. |
22:54 | <@ToxicFrog> | So you can do, say, header = struct.unpack(fd, "{ comment:z124 toc_offs:u4 }") |
22:55 | <@ToxicFrog> | McMartin: as in '.4' to skip four bytes of input or write four nuls to output? |
22:55 | <@McMartin> | Yeah. |
22:55 | <@McMartin> | On second thought, not as nice looking. |
22:55 | | * McMartin was thinking "4." |
22:56 | <@McMartin> | But that's because now I'm thinking in terms of python struct =P |
22:56 | <@ToxicFrog> | With this it's "[repetitions]<format><width>" |
22:56 | <@ToxicFrog> | So actually either "4.1" or ".4" would have the same effect, although the latter is faster. |
22:57 | <@McMartin> | Aha |
22:57 | <@ToxicFrog> | I don't really like how it looks, though, especially since p takes decimal widths (eg, 'p3.1') |
23:02 | <@McMartin> | Yeah. |
23:04 | <@ToxicFrog> | Ok. All read formats except for floating point are done. |
23:04 | <@ToxicFrog> | And FP is going to have to wait, because I need to drop into C for it. |
23:20 | <@ToxicFrog> | Hmm. |
23:20 | <@ToxicFrog> | I need a way to express "fixed length string with padding but without termination" for write. |
23:21 | <@ToxicFrog> | zW will pad, but will also terminate (so "z4","abcd" becomes "abc\0") |
23:21 | <@ToxicFrog> | sW will limit to W but will not pad. |
23:22 | <@ToxicFrog> | Maybe s0 should be 'string length', sW is 'exactly W bytes, padding if necessary', z0 is 'string length + terminator', and zW is 'exactly W bytes, padding and terminating' |
23:39 | <@MyCatVerbs> | ToxicFrog: please tell me you remembered to sort out endian-ness. |
23:40 | <@ToxicFrog> | Yes. |
23:40 | <@ToxicFrog> | There are symbols (<>=) to control what endianness it assumes. |
23:40 | <@MyCatVerbs> | Got a PDP-endian format in there, too? |
23:40 | <@ToxicFrog> | You can also ask it what endianness it's currently using. |
23:40 | <@ToxicFrog> | No, only big and little. |
23:49 | <@MyCatVerbs> | Just curious on that one, not like it'd actually matter in practice. |
23:53 | <@Finerty> | NUXI! |
23:57 | <@MyCatVerbs> | Finerty: gesundheit. |
23:58 | <@Finerty> | :D |
--- Log closed Mon Feb 25 00:00:09 2008 |