Anyone know of a good tutorial I can look at to learn, basically, what the hell I need to do to make C++ projects compile? I learned on VB and I also love C#, but C++ is just messing with me.
It's not the syntax or anything that's difficult, it's just all the hoops you've got to jump through to make the damn thing go.
No matter what, I can't compile anyone else's projects in microsoft C++. All the project settings, the linker, and WHAT THE FUCK IS A PRECOMPILED HEADER DIRECTIVE? Ambiguous error messages that could apply to hundreads of possible problems according to google (API Entry Point must be Defined? WTF?) Someone out there must understand all that crap that goes on up above the actual program itself, I mean, people write these things. So, where can I go to learn this secret knowledge?
Getting shit compiled in windows is no fun, even with (or maybe because of) an IDE.
Also, headers get #included into files, and thus are recompiled often despite never changing. Precompiled headers 'solve' this problem.
Name:
Anonymous2006-09-27 22:52
>>4
Will GCC really solve this problem then? I know that, for some reason, it makes executables about a meg larger than executables produced by Visual Studio, but I know that visual studio seems to link to libraries unneccesarily. I still cannot figure out by what magical process some of my programs require uuid.lib (which didn't come with VC++2005 express for some incredibly stupid reason) and other's don't.
Name:
Anonymous2006-09-27 23:05
>>5
Yes and no. I prefer the mingw (gcc-derived) toolchain over VC++, because most of these utilities expose what's going on underneath a lot better. I think the *nix way of doing things is a saner, and I find gcc's warning and error output useful.
Despite that, it's still not a cakewalk, particularly if you're chumming it up with win32-specific code. Development in Windows just isn't any fun.
You shouldn't notice that much difference in sizes, BTW. You must be thinking of cygwin, but most people using gcc in windows use mingw and derivatives. The projects I do vary between 150-500kb compiled.
Name:
Anonymous2006-09-28 1:04
>>6
So, what should I download? SHould I get an IDE? I really don't want to spend hours mucking around with downloading distribution binaries and stuff, I just want something that will work relatively well out of the box. Some sort of drag and drop compiler would be nice... But whatever would work, just give your best suggestions.
I'll warn you up-front though: starting your own project is a lot simpler than loading other people's. If you're a beginner at C or C++, you should not be poking at other people's projects.
Also remember that #including an include is not enough for a library. You need to tell the linker to include the appropriate library as well (project -> build options -> linker -> link libraries).
Name:
Anonymous2006-09-28 7:16
#including an include is not enough for a library
Not OP here, just BTW: This is a major design flaw. C should have had a way to specify required libraries and certain compilation options (which compilers may understand or not, but should attempt to not clash) in the source code (overrideable with compiler switches).
Name:
Anonymous2006-09-29 0:01
I'm really starting to think I should just stick with C#...
should be equivalent to linking again foo and passing /Ot to the compiler. Google indicates that this use of #pragma isn't unique to VC++. (Unfortunately, even the idiotic comment/lib pragma isn't unique.)
gcc sucks, gcc's optimization sucks, gcc's precompiled header support sucks, gcc's compilation speed sucks, gcc gives too many unnecessary warnings, gcc doesn't support useful pragmas, gcc doesn't support msvc's superior asm syntax, gcc sucks.
Name:
Anonymous2006-09-30 14:29
>>16
>gcc is awesome and i'm a script language user
fixed
Name:
Anonymous2006-09-30 19:14
>>16
GCC's optimization rocks. Warnings are great too; if your code produces too many warnings you fail. Pragma support sucks indeed. It's not "MSVC" syntax, it's Intel syntax and it's indeed superior, I don't know what are the GCC hippies thinking by supporting AT&T's piece of shit syntax. GCC overall rocks.
Name:
Anonymous2006-09-30 19:49
>>18
You can use a hybrid AT&T/Intel syntax with recent version of gas if you pass -masm=intel to GCC. It still has the %'s all over the place but at least the instructions have the right names and operands are in the right order.
Name:
Anonymous2006-10-01 21:20
GCC's optimization rocks.
It's so/so. You can't expect a portable compiler to do as well as Intel's.
if your code produces too many warnings you fail.
Yes indeed. Actually, it fails if it produces any warnings at all. If anything, -Wall isn't strict enough.
it's Intel syntax and it's indeed superior
Totally true. AT&T = complete lose. I swear they did that on purpose to keep people from using assembly.
Name:
Anonymous2006-10-02 3:48
>>20
Out of the free compilers, GCC's optimization is the only one that can, at least, be compared to Intel's, so I'm happy with it.
Name:
Anonymous2007-07-27 20:39 ID:wvTll2eF
Get the evaluation version of Visual Studio 2005, then use the special hack to get it to run forever.
Have you considered a functional language such as Haskell? Haskell can produce stand-alone binaries, and is generally easire to learn then C++
Name:
Anonymous2007-07-27 22:54 ID:cpQlyd3e
LLVM does a better job at optimization than GCC, although at the current time it's using the GCC front-end.
However, steps are being taken (by Apple?) to replace that front end with something faster and more flexible. I forget what it's called, but the compile-time of the current version supposedly rapes GCC (not hard, admittedly).