|
I am able to successfuly build my application when i link with my static library (which is built in debug option). But unfortunately i am not able to successfully execute my application when i link with static library(which is built in release mode). When i am debugging it is giving the following error
user breakpoint called from code 0x77f9193c.
Any help in this regard
Eswari
|
|
|
|
|
Sorry for disturbing you people again. I took another root. I built my static library and linked with the application. This time no /MDd or /MD flags.
When i am trying to link i am getting the following errors:
Created directory: debug
cl -GX -TP -D_DEBUG -Od -Zi -Fddebug\JsiD.pdb -nologo -c -W3 -DWIN32 -YX -Fpdebug\JsiD.pch -Fodebug/main.obj main.cpp
main.cpp
cl -GX -TP -D_DEBUG -Od -Zi -Fddebug\JsiD.pdb -nologo -c -W3 -DWIN32 -YX -Fpdebug\JsiD.pch -Fodebug/SBjsiCreateResourceTest.obj SBjsiCreateResourceTest.cpp
SBjsiCreateResourceTest.cpp
cl -GX -TP -D_DEBUG -Od -Zi -Fddebug\JsiD.pdb -nologo -c -W3 -DWIN32 -YX -Fpdebug\JsiD.pch -Fodebug/SBjsiDestroyResourceTest.obj SBjsiDestroyResourceTest.cpp
SBjsiDestroyResourceTest.cpp
cl -GX -TP -D_DEBUG -Od -Zi -Fddebug\JsiD.pdb -nologo -c -W3 -DWIN32 -YX -Fpdebug\JsiD.pch -Fodebug/SBjsiInitTest.obj SBjsiInitTest.cpp
SBjsiInitTest.cpp
cl -GX -TP -D_DEBUG -Od -Zi -Fddebug\JsiD.pdb -nologo -c -W3 -DWIN32 -YX -Fpdebug\JsiD.pch -Fodebug/SBjsiShutDownTest.obj SBjsiShutDownTest.cpp
SBjsiShutDownTest.cpp
link -nodefaultlib:libcd.lib -nodefaultlib:msvcrtd.lib -nodefaultlib:msvcrt.lib -nologo -machine:I386 -incremental:no -fixed:no -MAP kernel32.lib user32.lib advapi32.lib UnitTestDriver.lib -out:debug\JsiD.exe -debug -pdb:debug\JsiD.pdb -release -libpath:"d:\openvxi\lib" VXIlogD.lib VXIjsiD.lib UnitTestDriverD.lib xerces-c_2D.lib -libpath:"d:\openvxi/lib" -libpath:"c:\xerces-c-src_2_6_0/lib" -libpath:"d:\openvxi/test/lib" @C:\DOCUME~1\050343\LOCALS~1\Temp\nma01068.
LINK : warning LNK4049: locally defined symbol "_exit" imported
UnitTestDriver.lib(vostring.obj) : error LNK2001: unresolved external symbol __imp__sprintf
UnitTestDriver.lib(success.obj) : error LNK2001: unresolved external symbol __imp__sprintf
UnitTestDriver.lib(failure.obj) : error LNK2001: unresolved external symbol __imp__sprintf
debug\JsiD.exe : fatal error LNK1120: 1 unresolved externals
when i looked for the documentation one article says when you are trying to link with static and also linking with libc.lib you will get the following problems.
So what should i do.
Regards, Eswari
|
|
|
|
|
It appears that your project settings are set to use the shared C library, but you're linking against the static C library.
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"
|
|
|
|
|
How to change my project settings to inform that i am linking against static library.
Regards, Eswari
|
|
|
|
|
Hi All VC guru's
It is my first posting on code project . I came to know about this forum through my friend.
My probles is that I developed a application GsrApp using VC++ .NET 2003. This application runs fine on Windows 2000 , Windows 2003 & Window Xp home or professional . But yesterday I tried to run the same application on Windows 98 and Windows ME . But when I tried to run it got error :
GsrApp.exe caused invalid page fault in module user.exe
I coould not get through this problem because I cannot install VC++ .NET 2003 on Windows 98 or Windows ME as it could only be installed on Windows X, Windows 2000 & Windows 2003 . Hence couldnt formulate any way to debug my application on Windows 98 or ME . Please some Guru help me to get out of this problem . And tell me why I am failing on Windows 98 or ME
Singh, G
|
|
|
|
|
Is your application using Unicode?
|
|
|
|
|
Thanks for replying George , My application uses MBCS . What do you think should I use unicode for Windows 98 . And just for your information that I am also using adobe 5.0 libraries in my application.
Thanks
-- modified at 11:37 Friday 10th February, 2006
|
|
|
|
|
Hello All,
I am using a CListCtrl created in a dialog window. This CListCtrl displays thumbnail images.
I want a notification when a user double clicks an image in list. The OnLButtonDblClk function only works when user double clicks in the dialog window. It does not catch the event when a user double clicks in the list control window, probably because the dialog treats list control as a separate window.
Can anyone please let me know how do I write a event handler to to catch the event when an image in CListCtrl is double clicked.
Thanks in advance for your reply.
Abhijit Deshmukh
|
|
|
|
|
Override your own list control like CMyListCtrl from CListCtrl.
Enjoy
|
|
|
|
|
The listview control sends a NM_DBLCLK notification to its parent window when the user double-clicks in it. You can listen for this.
|
|
|
|
|
Hi
My VS 6.0 can not compile the unicode resource file. Who solved this problem?
Thanx.
|
|
|
|
|
|
|
Hi!
Is it possible to create codesnippets for C++ code that works with intellisense in Visual Studio 8?
|
|
|
|
|
Nope, C++ was left out of the code snippet group.
|
|
|
|
|
I am a great fan of MFC's CString class, especially it's Format member function. Makes things so easy. But I now have a problem that requires me to use a strstream buffer in a loop. How do I go about reinitializing the strstream so that I write to the beginning of the buffer at each loop iteration. This code does not work, the string in the stream does not change at all after the first iteration (stays at "%%1")
ostrstream stream;
for (x = 1; x < 10; ++x)
{
stream.seekp(0);
stream << "%%" << x << ends;
...
} This code however does work
for (x = 1; x < 10; ++x)
ostrstream stream;
stream << "%%" << x << ends;
...
} Recreating the strstream in each loop iteration seems like a silly way to get this to work.
"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!
|
|
|
|
|
use stream.clear(); inside the loop.
|
|
|
|
|
Nope, still does not work. I tried clear() alone, clear() followed by seekp(), and seekp() followed by clear(). All the same result as before.
"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!
|
|
|
|
|
actually no need of clear also. your code is right.
I want to know how did you get to know that the output is wrong.
please give that part of code.
because every thing is going fine in my code.
|
|
|
|
|
cout << stream.str() << endl; This line is added in the loop for debugging only. and the output is a series of identical lines "%%1". I also looked up the value in the debugger, used the second ostrstream c'tor where you can supply a char * buffer to be used as the stream and watched that buffer, etc. All have the same effect.
I am using VC6 SP6 with the Feb 2001 SDK if that makes any difference. I tried the code with VC7.0 but that was an even worse experience than with VC6, calling stream.str() results in an access violation at address 0x00000000.
Christian Graus is always saying how streams are the best thing ever, but I am having serious doubts about that
"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!
|
|
|
|
|
<code>ostrstream stream;
for (int x = 1; x < 10; ++x)
{
stream.seekp(0);
stream << "%%" << x << ends;
CString str = stream.str();
}
</code>
In the above code I am getting str value %%1, %%2 and so on...
I don't know why you have the problem.
Regards
Anil
|
|
|
|
|
#include <iostream>
#include <strstream>
using namespace std;
int main(int argc, char* argv[])
{
unsigned x;
ostrstream stream;
for (x = 1; x < 10; ++x)
{
stream.seekp(0);
stream << "%%" << x << ends;
cout << stream.str() << endl;
}
return 0;
} output is 9 lines of %%1
I rebooted my computer, created a new project just to test this and yet I still get the same result. Oh well, I guess I will go back to the inefficient way that works for me.
Thanks for your attempt to help.
"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!
|
|
|
|
|
Yes I got the solution but don't know the reason.
in VC6 you have to include #include <strstrea.h> instead of #include <strstream> I guess. The folloing code will work.
<code>
#include <iostream>
#include <strstrea.h>
using namespace std;
int main(int argc, char* argv[])
{
unsigned x;
ostrstream stream;
for (x = 1; x < 10; ++x)
{
stream.seekp(0);
stream << "%%" << x << ends;
std::cout << stream.str() << endl;
}
return 0;
}
</code>
Regards
Anil
|
|
|
|
|
Ok, mystery solved. The older version of strstream as declared in strstrea.h does not call freeze() which is why the code worked for you.
Thanks for your help
"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!
|
|
|
|
|
#include <iostream>
#include <strstream>
using namespace std;
int main(int argc, char* argv[])
{
unsigned x;
ostrstream stream;
for (x = 1; x < 10; ++x)
{
stream.seekp(0);
stream << "%%" << x << ends;
cout << stream.str() << endl;
stream.rdbuf()->freeze(false);
}
return 0;
} stream.str() calls freeze(true) to lock the buffer, I have to call freeze(false) to unlock it. Why your code worked without it is a mystery to me.
"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!
|
|
|
|