Linking to PURIFY libcef from Debug build

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Linking to PURIFY libcef from Debug build

Postby JoeAndrieu » Mon Oct 19, 2009 4:27 pm

I'm trying to run purify with the libcef and having a few problems. The first time I did it, using the DEBUG build of libcef, Purify just crashed. (I don't have the error available any more).

I am now trying to get the PURIFY build to link. It built fine, but when first linking it complained about LIBCMT.dll:
Code: Select all
3>LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj)
3>LIBCMT.lib(calloc.obj) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj)

3>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>Debug/SwitchBand.dll : fatal error LNK1169: one or more multiply defined symbols found


So I tried /NODEFAULTLIB:LIBCMT.lib. and /NODEFAULTLIB:LIBCMTD.lib.

The latter got rid of the LNK4098 warning, but not the conflicts.

The former got rid of the conflicts and the warning, but still had one unresolved symbol error:

Code: Select all
Error   24   error LNK2001: unresolved external symbol __invalid_parameter_noinfo   libcef_dll_wrapper.lib   1   


Any suggestions on how I might fix this?

(FWIW, I do run my own code's DEBUG under Purify just fine. That worked before I had the .pdb for libcef.)

-j
JoeAndrieu
Techie
 
Posts: 21
Joined: Wed Jun 10, 2009 6:44 pm

Re: Linking to PURIFY libcef from Debug build

Postby magreenblatt » Mon Oct 19, 2009 5:45 pm

I haven't tried building against Purify myself, but looking at your link errors it could be that your project configuration is not the same. Specifically, you may need to set the same runtime setting for all of the CEF projects and the Purify project.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Linking to PURIFY libcef from Debug build

Postby JoeAndrieu » Thu Oct 22, 2009 3:44 pm

Ok. That did it. Instead of using my DEBUG build, I'm using my RELEASE build and with a switch to the multithreaded non-dll setting, /MT, everything compiles and links just fine.

Is there any easy way to set the project defaults for all the Cef projects to, say, /MD? Or do I just have to manually do it for every single project file?

In any case, thanks for the tip.
JoeAndrieu
Techie
 
Posts: 21
Joined: Wed Jun 10, 2009 6:44 pm

Re: Linking to PURIFY libcef from Debug build

Postby magreenblatt » Fri Oct 23, 2009 8:42 am

Is there any easy way to set the project defaults for all the Cef projects to, say, /MD?

Well, easy is a relative thing :-) If you open cef.gyp in a text editor you'll see the following section:

Code: Select all
'conditions': [
        ['OS=="win"', {
          'msvs_settings': {
            'VCLinkerTool': {
              # Set /SUBSYSTEM:WINDOWS.
              'SubSystem': '2',
              'EntryPointSymbol' : 'wWinMainCRTStartup',
            },
          },
        }],
      ],

This is how you specify VS preferences as part of the gyp configuration. You'll need to identify the correct tool and setting by examining the .vcproj file contents and then add the appropriate blocks in cef.gyp.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Linking to PURIFY libcef from Debug build

Postby JoeAndrieu » Sat Oct 24, 2009 12:05 am

Cool. Thanks.
JoeAndrieu
Techie
 
Posts: 21
Joined: Wed Jun 10, 2009 6:44 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 81 guests