|
Part of the trouble was that I already had a project started and moved my files over to MSVC midway through. MSVC helpfully used the source directory to dump it's files into after that. I guess it's output directory is shared by the input directory as default, or something. Know any good write ups on property files I could browse? That might be a solid solution, depending how much it lets me control where and how MSVC looks for files and outputs content. Part of the reason it was giving me a headache was that it was attempting to link old files from the wrong directory after correctly building newer files, and since I just started using MSVC, I didn't know how to tell it to stop doing that. That's all solved now, but as I said, it's still dumping into wrong folders and generally placing files and folders where I don't want them to be.
|
# ? Dec 6, 2010 01:31 |
|
|
# ? May 21, 2024 00:13 |
Along with the Solution Explorer tab in the (default) left pane, there is also a Property Manager tab. There you can create/add property files and edit them. You can stack multiple property files, and use different stacks for each project configuration. Do note that property files have a Save button of their own, in the Property Manager pane! The basics are quite simple and I think it took me around 30 minutes to catch on to. One of the useful features is also that you can define custom macros, you can use in other property values. Some kind of overview Custom macros MSBuild (for hand-editing project and property files, to add more complex logic than the IDE lets you configure)
|
|
# ? Dec 6, 2010 01:48 |
|
Does anyone have any recommendations for a C graphing library? I'm considering DISLIN, Plotutils, or even embedding Python's matplotlib. What I really would like is functionality similar to MATLAB's quiver function in order to plot vector fields, so embedding Python might be the easiest route...however, I'm worried it will be slow, and it would be better if I could redraw the vector field in real time as various parameters change.
|
# ? Dec 6, 2010 04:41 |
|
Thanks for the links. I'll have time later this week to take a look at them. Maybe I'll check out their full range of options more in-depth later on.
|
# ? Dec 7, 2010 02:03 |
|
I've been programming casually in Java for the past 4-5 years now, with a some extra classes as a CS student in the past year. I basically have zero C/C++ experience, though, which is something I'd like to change. I've got a copy of The C Programming Language, and the OP recommends The C++ Programming Language, but I see really good things about C++ Primer Plus on Amazon. Is anyone here familiar with all of these books? C++PP just seems like such a huge book compared to The C Programming Language, but The C++ Programming Language isn't any better in that regard. Is C++ just an incredibly "large" language or what? Safe and Secure! fucked around with this message at 07:41 on Dec 8, 2010 |
# ? Dec 8, 2010 07:36 |
|
Safe and Secure! posted:Is C++ just an incredibly "large" language or what? C++ = C + exceptions + Simula-style objects + multiple inheritance + parametric polymorphism + ....
|
# ? Dec 8, 2010 08:15 |
|
Safe and Secure! posted:Is anyone here familiar with all of these books? C++PP just seems like such a huge book compared to The C Programming Language, but The C++ Programming Language isn't any better in that regard. Is C++ just an incredibly "large" language or what? Accelerated C++ is another commonly suggested introductory book, followed by Effective C++.
|
# ? Dec 8, 2010 09:17 |
|
that awful man posted:C++ = C + exceptions + Simula-style objects + multiple inheritance + parametric polymorphism + .... + another Turing-complete language (hi templates!)
|
# ? Dec 8, 2010 12:45 |
|
I am trying to write a program in Mac OSX that looks at the metadata that is inside a binary. I found an API nlist() that seems to fit my needs. The code I have is at http://codepad.org/EUQRdHYg The problem I have is that at the linker stage I am getting this error code:
Does anyone have any ideas on what I am doing wrong?
|
# ? Dec 9, 2010 20:06 |
|
Pug1233 posted:I am trying to write a program in Mac OSX that looks at the metadata that is inside a binary. I found an API nlist() that seems to fit my needs. I asked our CC tools guy, and the consensus seems to be that you should not be using nlist, and that it's probably a bug that the manpage still exists. You don't need to use extern "C", though, the header already does that. What are you actually trying to do? rjmccall fucked around with this message at 21:13 on Dec 9, 2010 |
# ? Dec 9, 2010 21:11 |
|
e: posted full code. A pretty simple question I think but I can't figure out if I'm doing anything wrong. I'm trying to create a method for the ExpTree class that returns a pointer to an object of type node and its input is a pointer to an iterator. cpp file: code:
code:
Errors: code:
slacjs fucked around with this message at 22:17 on Dec 9, 2010 |
# ? Dec 9, 2010 21:29 |
|
rjmccall posted:I asked our CC tools guy, and the consensus seems to be that you should not be using nlist, and that it's probably a bug that the manpage still exists.
|
# ? Dec 9, 2010 21:35 |
|
Fragaroc posted:A pretty simple question I think but I can't figure out if I'm doing anything wrong. If I reconstruct a trivial program with those lines, it works in gcc, so I think you will need to post the error you are getting or maybe more code.
|
# ? Dec 9, 2010 21:41 |
|
Fragaroc posted:A pretty simple question I think but I can't figure out if I'm doing anything wrong.
|
# ? Dec 9, 2010 22:05 |
|
Vanadium posted:If I reconstruct a trivial program with those lines, it works in gcc, so I think you will need to post the error you are getting or maybe more code. Plorkyeran posted:That function takes a reference to a pointer to an iterator. Thanks again. slacjs fucked around with this message at 22:21 on Dec 9, 2010 |
# ? Dec 9, 2010 22:18 |
|
I took That Turkey Story's advise and here is my second iteration of SharedPtr class:code:
pr0metheus fucked around with this message at 22:40 on Dec 9, 2010 |
# ? Dec 9, 2010 22:35 |
|
Pug1233 posted:Well I need to be able to determine if there is any debug information in an iPhone binary that will give hints on what functions were compiled as Thumb (or ARM). When looking at the nlist.h file, there is a constant called N_ARM_THUMB_DEF and I wanted to confirm that the constant was used before I went to the next step. Oh, there's a much easier way to test for that. The processor has to know whether a function is compiled for Thumb so that it can switch modes if necessary, so the function pointer encodes whether the function is ARM or Thumb in its low bit. code:
|
# ? Dec 9, 2010 23:00 |
pr0metheus posted:I took That Turkey Story's advise and here is my second iteration of SharedPtr class: Careful about that operator =, you're forgetting to unref the previous pointer, leaking ref counts. As for operator ->, I'm pretty sure it's just supposed to return the pointer that the object wraps and the compiler then handles all the fancy stuff. You'd need a lot of crazy RTTI if the operator should be able to completely customise the look-up on the right-hand side of the ->. (I think that's what you're getting at.)
|
|
# ? Dec 9, 2010 23:07 |
|
Fragaroc posted:Thanks for having a look, I've posted the rest of the code in the original post. Since Node is a type inside ExpTree<TE>, you need to define the function as: template<class TE> typename ExpTree<TE>::Node* ExpTree<TE>::subBuild(std::list<std::string>::iterator* it) { ...
|
# ? Dec 9, 2010 23:09 |
|
pr0metheus posted:
Also, operator= should always return a reference to this so that chaining works. pr0metheus posted:I don't quite understand why -> operator works by just returning *. Can somebody explain semantics of it and why returning the pointer works? Plorkyeran fucked around with this message at 23:25 on Dec 9, 2010 |
# ? Dec 9, 2010 23:19 |
|
rjmccall posted:Oh, there's a much easier way to test for that. The processor has to know whether a function is compiled for Thumb so that it can switch modes if necessary, so the function pointer encodes whether the function is ARM or Thumb in its low bit. I can get a list of all addresses of the functions in a given program and those addresses will always be even (as confirmed by IDA) and will always be divisible by 2 but it may also be divisible by 4, which is why I need a better way then using the address.
|
# ? Dec 9, 2010 23:31 |
|
Is there a set of win32 API calls that can open a .CAB file like a filesystem/directory as you would in windows explorer? I'd like to write a function that acts as findfirst/findnext but does so with a .CAB file as a file path rather than a system path. Oddly enough I'm having a hard time googling for the proper APIs that interact with Cabinet.DLL.
|
# ? Dec 9, 2010 23:48 |
|
http://msdn.microsoft.com/en-us/library/bb432569.aspx is the documentation for the cabinet API. Getting a list of files in the cabinet appears to be fairly awkward: the extract all function (FDICopy) takes a callback which receives information about each file before it's extracted and can tell the extractor to skip extracting the file.
|
# ? Dec 10, 2010 00:27 |
|
Pug1233 posted:While that is true if you have a function pointer to a function, as the compiler will add one to the true address of the function, but I am concerned with all functions and not just ones that have function pointers. It's a lot more than just the compiler, but yes, if you need to know this for a blob of code that you can't take the address of then you'll need something else. Anyway, I *think* nlist will only fetch for the current architecture slice, and we don't offer an nlist for x86-64 or ARM. The debugger folks suggest using either libbfd or lldb, or alternatively there's an offset to the stabs in the MachO load commands. Pug1233 posted:I can get a list of all addresses of the functions in a given program and those addresses will always be even (as confirmed by IDA) and will always be divisible by 2 but it may also be divisible by 4, which is why I need a better way then using the address. Yes, trying to infer thumbness from the 4-byte parity of the raw address will clearly not work for many reasons.
|
# ? Dec 10, 2010 01:11 |
|
How can I fill an _m128 vector with 0x7FFFFFFF other than doing something retarded like:code:
_mm_set1_ps(0x7FFFFFFF); ends up as 0x4F000000
|
# ? Dec 10, 2010 10:25 |
|
Sounds like you are looking for _mm_set1_epi32, that's just a compound operation as well, similar to your initial code. _ps is just for floats. EDIT: Though it may still be a better implementation... digibawb fucked around with this message at 13:37 on Dec 10, 2010 |
# ? Dec 10, 2010 13:32 |
|
digibawb posted:Sounds like you are looking for _mm_set1_epi32, that's just a compound operation as well, similar to your initial code. _ps is just for floats. I found a neat way this morning: code:
slovach fucked around with this message at 22:37 on Dec 10, 2010 |
# ? Dec 10, 2010 21:24 |
|
I missed the fact that your ultimate goal was to perform a fabs, sorry. You could also look at: _mm_max_ps( _mm_sub_ps( _mm_setzero_ps(), xyz ), xyz ); as that doesn't require any loads at all, but it depends how your register congestion is I guess! EDIT: I've been stuck in PPC land for a while, so I'm a bit fuzzy on SSE and its general bottlenecks though, but it might help
|
# ? Dec 10, 2010 21:40 |
|
digibawb posted:I missed the fact that your ultimate goal was to perform a fabs, sorry. I'm barely using any registers. I was playing around to see if I could beat fsincos. In 3 multiplies and an addition I have both a sine and cosine with pretty sketchy precision. 2 more and another abs and precision is much closer. Haven't got around to actually profiling it yet but was a fun experiment nevertheless
|
# ? Dec 10, 2010 23:23 |
|
I'm trying to typecast a char as an integer, while said char is in a string. It is not working. Here is the code snippet in question:code:
|
# ? Dec 12, 2010 00:38 |
|
The text "argv[1][i]" contains 10 characters, which is too large to be assigned to a const char.
|
# ? Dec 12, 2010 00:47 |
|
wlokos posted:I'm trying to typecast a char as an integer, while said char is in a string. It is not working. Here is the code snippet in question: You're not typecasting argv[1][i] there, you're wrapping it in apostrophes. This means nothing to the compiler and it's telling you that the the phrase "argv[1][i]" is not a single character (which it obviously is not). A C-style typecast from int to char looks like this: int i = (char)argv[1][i]; But that is completely pointless anyway because argv is a char**, which means argv[1][i] is already a char.
|
# ? Dec 12, 2010 00:48 |
|
Right, I'm trying to turn the char argv[1][i] into an int. Would that look like code:
I thought wrapping it in apostrophes made it an int because I did things like code:
|
# ? Dec 12, 2010 01:08 |
|
'a' is a character literal, which in C is the same as the ASCII value 97.code:
|
# ? Dec 12, 2010 01:11 |
|
int i = 'j'; int j = 'i';
|
# ? Dec 12, 2010 01:13 |
wlokos posted:Right, I'm trying to turn the char argv[1][i] into an int. Would that look like The latter works because it's the value of a literal 'a' you want, not the value of something stored in a variable named 'a'. The quotes signify a literal value: Single quotes (apostrophes) are character values, and double quotes are string values (character arrays implicitly terminated by a \0 character). When you want to convert the value stored in a variable to a different data type, you use a typecast operator, as you do in your first code block here.
|
|
# ? Dec 12, 2010 01:17 |
|
Vanadium posted:int i = 'j'; code:
|
# ? Dec 13, 2010 17:38 |
|
Exception Question: Is there a way to create an exception class, that when thrown (and not caught) prints a meaningful error message? What I have been getting is it will say something along the lines of: code:
|
# ? Dec 14, 2010 22:26 |
|
Harokey posted:Exception Question: Not standard, no. Why do you want this? What's wrong with putting try/catch in main? If you're dealing with exceptions thrown from globals then you're stuck with wrapping your objects.
|
# ? Dec 14, 2010 22:37 |
|
|
# ? May 21, 2024 00:13 |
|
That Turkey Story posted:Not standard, no. Why do you want this? What's wrong with putting try/catch in main? If you're dealing with exceptions thrown from globals then you're stuck with wrapping your objects. I'm writing a C++ library that is used for CS1 courses. If this is the case, like It seems to be, I guess I'm better off just creating somewhat meaningful error messages and calling exit(). Edit: Which I've started to do, but wanted to make sure that there wasn't a way to do this with exceptions, because it seems to be the more "correct" way to do it.
|
# ? Dec 14, 2010 22:49 |