|
I have two programs in a project.
1st, in a1.cpp
string str1;
string func()
{
str1="A simple string";
return (str1);
}
2nd, in a2.cpp
extern func();
void func1()
{
ofstream myfile;
myfile.open (path.c_str());
myfile<<str1;
}
Now wen I built it I get
LNK2001: unresolved external symbol "int __cdecl func(void)" (?func@@YAHXZ)
fatal error LNK1120: 1 unresolved externals
HOW TO RESOLVE THIS.. THANKS
|
|
|
|
|
pl_kode wrote: extern func();
probably you are using older compiler it shows error in newer version
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
specify the return type it is taking default int.
extern string func();
do you heard about declaration and header files, what about declaring the function in header a1.h and including it in a2.cpp
|
|
|
|
|
thanks, it worked by using extern string func();
|
|
|
|
|
Hi All,
Given a data I want to write a pdf file. Is it possible to do it using MFC..???
Reagards
Shiva
|
|
|
|
|
MFC doesn't have support to create PDF files. You need to use something like Haru[^], for the same.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
nice lib!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
Thats gr8.These r good one.
Thanx.
Reagards
Shiva
|
|
|
|
|
you are welcome! shameless plug:- please vote fo rme
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
OK, I'll do it for you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
he he he thanks ! i am big fan's of yours!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
Hamid. wrote: How to create PDF file from Visual C++[^].
you always has good example then me
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Because you used of fast connection.
|
|
|
|
|
Hamid. wrote: Because you used of fast connection.
off course faster connection
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
Great, recorded as my tip!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
I'm migrating some code from vc++6 to vc++2008, and I have error when trying to add string to an combo box:
'CComboBox::AddString' : cannot convert parameter 1 from 'char [256]' to 'LPCTSTR' ???
Help converting char[256] to LPCTSTR
Thanks
|
|
|
|
|
It's because UNICODE is defined by default for VC2008. Disable unicode and it should fix the problem. If you want a deeper understanding of what is happening, I suggest this article[^]
|
|
|
|
|
Thanks for replay, but when I use multi-byte instead of unicode character set I get numerous identical error :
'error LNK2001: unresolved external symbol __iob' in file: 'mysqlclient.lib'
?
edit:
is there a solution for my first post whiteout changing the character set?
Thanks
|
|
|
|
|
You may declare a TCHAR (instead of char ) array. But then you'll probably have to convert also many other pieces of code to make your application 'generic text mappings'[^] compliant.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
josip cagalj wrote: cannot convert parameter 1 from 'char [256]' to 'LPCTSTR' ???
Help converting char[256] to LPCTSTR
if you could convert/add new something in your application, try changing occurence of char to TCHAR, which could handle string in generic way, you might have to change some string manipulation function also.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
After using TCHAR Buf[256] instead of char Buf[256] I get error with sprintf(Buf,"%s",...) saying "cannot convert parameter 1 from TCHAR [256] to char*"
|
|
|
|
|
When using generic Text Data type, use Generic Text Mapping routines,
use _stprintf in place of sprintf
|
|
|
|
|
I used 'wprintf' adn it worked (no errors reported). Can I use this?
When I used '_stprintf' like this:
_stprintf(Buf,"%s",cur[off]);, or
_stprintf(Buf, "");
I get error saying "cannot convert parameter 2 from const char[3] to wchar_t"!
|
|
|
|