|
Hello. I'm currently having a problem linking a single threaded library to a multithreaded program.
I'm using Haru pdf library found here: http://sourceforge.net/projects/libharu/
Is there any way I can change the project or makefile to work with my multithreaded project?
I believe this is the problem as I am getting the following errors:
--------------------------------------------------------------
Linking...
LIBCMT.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMT.lib(nlsdata1.obj) : error LNK2005: ___mb_cur_max already defined in _libc_fix.obj
LIBCMT.lib(lconv.obj) : error LNK2005: _localeconv already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMT.lib(ctype.obj) : error LNK2005: __pctype already defined in _libc_fix.obj
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMT.lib(strtol.obj) : error LNK2005: _strtoul already defined in MSVCRTD.lib(MSVCRTD.dll)
LIBCMT.lib(getenv.obj) : error LNK2005: _getenv already defined in MSVCRTD.lib(MSVCRTD.dll)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __ltoa already defined in LIBCMT.lib(xtoa.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCMT.lib(mbctype.obj)
LIBCMT.lib(tolower.obj) : warning LNK4006: _tolower already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(crt0dat.obj) : warning LNK4006: _exit already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(crt0dat.obj) : warning LNK4006: __exit already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(nlsdata1.obj) : warning LNK4006: ___mb_cur_max already defined in _libc_fix.obj; second definition ignored
LIBCMT.lib(lconv.obj) : warning LNK4006: _localeconv already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(ctype.obj) : warning LNK4006: __pctype already defined in _libc_fix.obj; second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj); second definition ignored
LIBCMT.lib(winxfltr.obj) : warning LNK4006: __XcptFilter already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(strtol.obj) : warning LNK4006: _strtoul already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored
LIBCMT.lib(getenv.obj) : warning LNK4006: _getenv already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: __ltoa already defined in LIBCMT.lib(xtoa.obj); second definition ignored
MSVCRTD.lib(MSVCRTD.dll) : warning LNK4006: __setmbcp already defined in LIBCMT.lib(mbctype.obj); second definition ignored
Creating library Debug/DA20.lib and object Debug/DA20.exp
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/DA20.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
DA20.exe - 17 error(s), 17 warning(s)
--------------------------------------------------------------
Any help would be greatly appreciated.
Thanks.
|
|
|
|
|
To use multithreaded runtimes, Go to Project settings->C/C++ tab and select Category combo to Code Generation and use runtime library to mutlithreaded
|
|
|
|
|
That works in debug mode, but does not in release. Also that seems like I'm changing my current project's settings to fit the library rather than the other way around.
Is there a way to change the library?
|
|
|
|
|
I'm trying to make a lamp control with a 'LampOn' property. If the LampOn property is true, the control shows an image of a green lamp. If it's false, the control shows a red lamp. The two lamps are resources and the image is displayed as the background image of the control. Nothing else is displayed in the control.
I use this code for the LampOn property:
property bool LampOn {<br />
bool get() {<br />
return (BackgroundImage == (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"on"))));<br />
}<br />
void set(bool val) {<br />
if (val) <br />
BackgroundImage = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"on")));<br />
else <br />
BackgroundImage = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"off")));<br />
}<br />
}
However, if I want to use the control in a windows form, the lamp won't be usable. The property appers but I can't switch it to true. I'm pretty sure this has to do with the get code in the property. Any ideas what I did wrong?
Here the whole project (VC 2005): Click
|
|
|
|
|
The .zip file appears to be corrupt (missing 10 bytes). Also, the correct url is this[^].
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I fixed that, for some reason my host won't allow the zip file. I'm sorry that I had to use Rapidshare...
New Link[^]
Any ideas regarding my problem?
|
|
|
|
|
tdlrali wrote: BackgroundImage = (cli::safe_cast(resources->GetObject(L"off")));
Its better you post your Managed C++ based Question in its personel forum :-
CLI/C++[^]
"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
|
|
|
|
|
So no help here? If not I will post it over there.
I'm sure it's not a big thing, can nobody help me?
|
|
|
|
|
tdlrali wrote: I'm sure it's not a big thing, can nobody help me?
Its not big thing for Managed C++ Programmmer.. But about normal VC++ programmer... its like asking a Database person problem of JAVA!..
Thats why I given you link of Managed C++ forum!.. hope now you understand why you not getting answer there
"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
|
|
|
|
|
|
toxcct wrote: CLedButton[^]
Hai Tox,
Its seems he has problem related to Managed C++ and he willing to make its own control, I hope you are comfortable enough in Managed ... to solve his problem.
"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
|
|
|
|
|
ThatsAlok wrote: I hope you are comfortable enough in Managed ... to solve his problem.
nop not at all
ThatsAlok wrote: Its seems he has problem related to Managed C++
yeah, i saw this, but it seemed that the guy didn't know where to look... actually, it is not the right answer, but he's now aware that CP is the best place for search a search...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
I am new to the forum, so please bear with me. I have since created an Acrobat plugin using Visual C++ 6 along with the Acrobat SDK 6. While the Acrobat API provides a means to create and add an 'About' dialog box, for reasons too numerous to list, I would rather use MFC to create a simple 'About' dialog box for my plugin. As of this time, I already have code inside my plugin initialization cpp file that creates my 'About' menu item for an 'About' box. There is also an area for inserting code that creates the 'About' box that gets called from the 'About' menu item. The'About' box I'm looking to create would contain the usual title in the title bar along with 3-4 short lines of static text inside the dialog box, and two buttons namely, an 'Ok' button to close the dialog, and another button with my web site URL. As I already have the MFC installed on my system, rather than reinvent the wheel, I'm looking for a code snippet to accomplish this task and the easiest way to integrate the code to create my 'About' dialog box. I would also like to know if the code using MFC to create a dialog box can be added to the initialization cpp file that creates the plugin or if I need to create a separate cpp file to accomplish this task? While I'm a relative newcomer to using C++ and have been able to learn enough to create a plugin, I do have to admit that I'm far from being an expert C++ programmer. Needless to say, any and all feedback anyone can provide to help me accomplish this particular task is very much appreciated. ;)
|
|
|
|
|
have you already created the dialog? and
is that if you try to launch the dialog the dialog would not open?
-Prakash
|
|
|
|
|
No. As I already stated, I'm looking to create the dialog for my 'About Box' using MFC. I would imagine that, given the code to create a dialog for my 'About Box' using MFC, I would then be able to integrate the code into the cpp file that creates my plugin.
|
|
|
|
|
Did you try using the resource Editor?
There you can design the dialog and add a class to that dialog template and load the dialog when you need it.
-Prakash
|
|
|
|
|
I will check it out but I was actually hoping to find a simple coded dialog to integrate into my plugin file to see if this will work to begin with.
|
|
|
|
|
building a simple dialog using the resource builder will take about 3 min. you cant get faster than that
-Prakash
|
|
|
|
|
Hi,
I have an array of values that is unsorted, having values like 12, 18, 15, 25, 22, 27, 21, 30, 19, 2
I want to rank them acording to the follwing rule , Lets they are 10 values in total
Greater value has the number 10, values less then this will have number 9 , so on , and the least value will have number 1.
How can I do it
thanks
Regards.
|
|
|
|
|
Why can't you just sort the array. The values will be ranked to your given criteria:
rank = "array index of value" + 1.
|
|
|
|
|
zahid_ash wrote: I have an array of values that is unsorted, having values like 12, 18, 15, 25, 22, 27, 21, 30, 19, 2
Apply reverse Bubble Sort and check the Element at the Index!
"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
|
|
|
|
|
ThatsAlok wrote: zahid_ash wrote:
> I have an array of values that is unsorted, having values like 12, 18, 15, 25, 22, 27, 21, 30, 19, 2
Apply reverse Bubble Sort and check the Element at the Index!
Attention!
This only works if no values appear twice in the vector!
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
jhwurmbach wrote: This only works if no values appear twice in the vector!
Thanks for correcting me.. But it seems there is no vector here.. the person seems using old C based array and if you see I especially Quoted his number before giving the answer!
"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
|
|
|
|
|
ThatsAlok wrote: But it seems there is no vector here
But it really should
And its just a matter of:
std::vector<int> vec( &array[0], sizeof(array)/sizeof(array[0]));
to copy array into the STL-vector vec .
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
jhwurmbach wrote: But it really should
Yeah you are right
"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
|
|
|
|