Search code examples
gcclinkerlinker-errorschromium-embedded

undefined reference to `CefURLRequest::Create(CefRefPtr<CefRequest>, CefRefPtr<CefURLRequestClient>)'


I am trying to build CEF in Release mode but I get the following linker error:

AR(target) /home/adminuser/temp/build/linux/Release/obj.target/libcef_dll_wrapper.a LINK(target) /home/adminuser/temp/build/linux/Release/cefclient /home/adminuser/temp/build/linux/Release/ldb.a(ldbJS.o): In function LdbURLLoader::LoadURL(std::string)': ldbJS.cpp:(.text+0x34e): undefined reference toCefURLRequest::Create(CefRefPtr, CefRefPtr)' collect2: error: ld returned 1 exit status make: *** [/home/adminuser/temp/build/linux/Release/cefclient] Error 1

I don't get this problem when building the Debug version so I am not quite sure how to resolve it. I tried various #pragma directives to stop the compiler from optimizing out this method but to no avail.

* UPDATE *

When I remove the -DNDEBUG flag from CFLAGS_Release in the libcef_dll_wrapper.target.mk file it will build. I don't want to do this in the Release build without knowing what I'm doing though.

I am using gcc 4.8.2.


Solution

  • It turns out forcing the LD linker to reanalyze my libraries was the solution. The CEF application already had an elaborate scheme of makefiles that used the --start-group and --end-group indicators to do this, but the library I previously added was not included with them. I added it and linked my application without any more problems!