|
|
Looks like like your class has declared a destructor but not defined it. ie:
class CFooClass<br />
{<br />
public:<br />
CFooClass();<br />
~CFooClass();<br />
};<br />
<br />
CFooClass::CFooClass()<br />
{<br />
}<br />
<br />
|
|
|
|
|
Yes, it looks like i don't have a destructor in my cpp file, but i have...
I found a way you can check it - in the wizard you can create a new class, but then delete it from the solution, and include it just in stdafx.h. You'll get the same error as I... So my question is - how to include library, without insertig library in the project
|
|
|
|
|
Are you just including the .H file in your project without the corresponding .CPP file? If this is the case the impementation must come from somewhere...Perhaps you want to build a static library (.LIB file). When you do this you just include the .H file and add the .LIB file to the linker tab (or use a #pragma comment(lib, "libname.lib")).
Steve
|
|
|
|
|
Look at the missing func:
"public: __thiscall CFooClass::~CFooClass(void)"
If it's ment to be a destructor, wouldn't it look like this:
"public: __thiscall CFooClass::~CFooClass()"
That is, without the "void" ?
|
|
|
|
|
Rassul Yunussov wrote: Exactly - i got :error LNK2001: unresolved external symbol "public: __thiscall CFooClass::~CFooClass(void)"
Either you fail to include the .cpp or .library file
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
The question relates only to large projects (defined as >= 100,000 lines of code) compiled with Visual C++ compiler. If you work(ed) on such projects, I would appreciate if you could share your experience. Is it a must in this case? Thanks!
Nick Kisialiou
|
|
|
|
|
every day. What do you need exactely ?
~RaGE();
|
|
|
|
|
Hi,
whats the benifit of using make files instead of the Rebuild option in VS itself.
Is it better/faster on single project solution?
Or is it better/faster on multi project solutions?
I notice that the build option in VS isn't 100% safe (sometimes it doesn't notice changed code)
could a make file help me in this.
codito ergo sum
|
|
|
|
|
I mean exactly what BadKarma says. Have you ever done a large project without command line compiling/linking? Is it worth planning in advance that the project be compiled in command line, possibly later in the development cycle?
|
|
|
|
|
Hi guys im trying to code a recursive function in which you are to find all permutations of a string of 1's and 0's of size N. Well ive been working on this thing for hours now and realized my algorithm for solving this is just wrong.
Ive been using an array of bits yielding 2^N permutations but it seems to be getting messy. I was writing code in which only cattered to small numbers of N like 2 or 3.
Any advice on a basic algorithm on how to deal with all sets of N would help, becuase im really stuck. Thanks in advance!
-Example of whats required-
N = 3
//output
000
001
011
100
101
010
110
111
|
|
|
|
|
Well, if you look at the pattern, you'd find that the permutation of 3 bits is made up of two distinct halves - a '0' followed by the permutation of two bits, and a '1' followed by the permutation of two bits.
Make a function that takes in N and a prefix of the bits already determined as parameters...
void permute(int n, std::string prefix) such that if you call it as permute(2, "0") , it would print all the permutations of 2 bits with a '0' in front of each one.
If you think about it, notice that a permutation of 3 bits is then
permute(2, "0");
permute(2, "1"); and a permutation of 4 bits is
permute(3, "0");
permute(3, "1"); Notice the pattern?
See how you go with this
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Here's one way:
#include <iostream>
#include <bitset>
using namespace std;
int main(int argc, char* argv[])
{
enum
{
NumberOfBits = 7
};
typedef unsigned int NumType;
typedef bitset<NumberOfBits> BitSetType;
for (NumType i=0; i<(1<<NumberOfBits); ++i )
{
cout << BitSetType(i) << endl;
}
return 0;
}
This will only work for 32 bits of less (number of bits in unsigned int). Assumes 8 bits pre char.
Steve
|
|
|
|
|
A really easy way to do this would be to increment an integer on every permutation and convert that integer into a binary string. The downside is that N can't be >= than the number of bits in the integer.
const int N = 8;
long maxPermutations = 2 << N;
long permutation;
for (permutation = 0; permutation < maxPermutations; permutation++)
{
}
|
|
|
|
|
Hello everyone!
Does anyone know of an Assembler function that works kind of like Kernel32.dll 's Beep() function? (The NT-family version, please. ) I want it to be an easy-to-use function which I can embed into C, because I don't feel ready to mess with the Assembly yet... Anyone know? Thanks!
P.S: Preferably, it needs to work on DOS...
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
You could just print character code 0x07 to the display... That tends to generate a rather unhealthy sounding beep
printf("\x07"); should do the trick.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I draw some icons on the SDI view .the icons are of greenish backcolor in vc++6.0 icon editor.
how to draw icon on the view without black backcolor ?
this is my code:
...
myImageList.Create(48,48,ILC_COLOR8,1,1);
myImageList.Draw(pDC,index,myPoint,ILD_NORMAL);
|
|
|
|
|
Hi there, I'm trying to write a program that takes another precompiled project (was doing this in GCC but now trying in Visual Studio, bit of a jump I know....) and executes the code in it. I know this sounds like using a standard DLL but here's the bit that's got me stumped.
The precompiled project (written in C) is made up of a bunch of functions (called from the main program) but these functions call functions in the main program. I can get the first part working but I can't figure out how to make the DLL use some of the main functions. Any books I have and any internet info I've found only seem to cover the first part but not the second.
As shown in the title this is for an emulator type program.
If someone could at the very least tell what doing this is called, it would help immensely! Please ask if I need to explain more.
Thanks.
|
|
|
|
|
Probably the easiest way would be to pass function pointers to the DLL which it would use to callback into the .EXE. Here's the basic idea:
typedef void (*PMainFunc)() PMain;<br />
extern "C" void SetCallback(PMainFunc pCallback);<br />
<br />
void InMainCalledFromDll()<br />
{<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
SetCallback(&InMainCalledFromDll);<br />
}
There are many variation of this theme, for example passing the address of a structure of function pointers or using virtual functions. This should get you started.
Steve
|
|
|
|
|
It sounds like you have a circular dependency, where your library expects the program using it to have functions with specific names. This is a questionable design, but legal as long as it's a static-link library, not a DLL.
A better design is to have the app pass a pointer to a callback function, which the library code calls as needed.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks for the replies. Yeah I realise the overall design is questionable but it's basically necessary, the program is to employ C code that's been written for a Microchip device and emulate the already written OS it runs on top of. The idea being I can write and test code without having to build the actual device that uses it straight away.
Thanks again!
|
|
|
|
|
I am new to c++,VC++. I am working on a project where i difference two files.
I am passing in the Header Names as commandline arguments in the following format.
cat:dog:pig:don key:owl.
cat,dog and pig is ok. But "don key is not getting recognised.It is read as just "don". I should be able to read it as "don key" or i might replace the white space with something else.
Please help.
-- modified at 19:11 Monday 13th February, 2006
|
|
|
|
|
The command-line parser uses spaces as a limiter. To override this you must place quotes around parmeters that have spaces:
someexe cat dog pig "don key" owl
or
to keep your original format:
someexe "cat:dog:pig:don key:owl"
this would be read as one parameter.
-- modified at 19:24 Monday 13th February, 2006
|
|
|
|
|
|
I was wondering if anyone knew of a way, if it is even possible, to declare a macro with a variable parameter list. Say I have a function with a long name, in a class with a long name, in a namespace with a long name and I want to remame it with a short name
LongNamespaceName::LongClassName::LongFunctionName(int, ...);
#define shortname(x, ???) LongNamespaceName::blah Never mind the merits of good or bad or why, I just want to know if and how.
I don't think it is possible, but I will never know if I don't ask.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|