Coder Social home page Coder Social logo

Comments (12)

DigitalInBlue avatar DigitalInBlue commented on August 17, 2024

Did you compile with the CMake variable CELERO_COMPILE_DYNAMIC_LIBRARIES set to OFF? If you did, there should be a precompiler definition of CELERO_STATIC for all of your projects. When that is set, Export.h is supposed to give blank definitions to CELERO_EXPORT and CELERO_EXPORT_C. When this is true, you will not have __declspec(dllimport) used in your project, but this is exactly what I see in your log file. Check to make sure CELERO_STATIC is defined in all of your projects.

from celero.

everyonecancode avatar everyonecancode commented on August 17, 2024

While adding CELERO_STATIC did fix _declspec(dllimport) errors, I've got a new one:

celerod.lib(Utilities.obj) : error LNK2019: unresolved external symbol CallNtPowerInformation referenced in function "void __cdecl celero::DisableDynamicCPUScaling(void)" (?DisableDynamicCPUScaling@celero@@YAXXZ)

Again, same code (from the example you provided), works with dll build.

from celero.

DigitalInBlue avatar DigitalInBlue commented on August 17, 2024

See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa372675(v=vs.85).aspx

Looks like PowrProf.lib needs to be included. (I haven't actually built with static libraries myself.)

from celero.

everyonecancode avatar everyonecancode commented on August 17, 2024

Yes, adding PowrProf.lib fixed this issue.

Will you fix the static build or just advise against using it? Either way, I think it would be a good idea to update the README file on project's page.

from celero.

DigitalInBlue avatar DigitalInBlue commented on August 17, 2024

from celero.

everyonecancode avatar everyonecancode commented on August 17, 2024

No problem. Thank you for creating this great library :)

from celero.

zamazan4ik avatar zamazan4ik commented on August 17, 2024

Can you close this issue?

from celero.

MichaelMauderer avatar MichaelMauderer commented on August 17, 2024

Has this actually been fixed? I just ran into this issue (Visual Studio 14 2015 Win64) with the current version.

from celero.

DigitalInBlue avatar DigitalInBlue commented on August 17, 2024

Was the issue that "PowrProf.lib" was not linked or is your problem a new issue?

from celero.

MichaelMauderer avatar MichaelMauderer commented on August 17, 2024

Yeah exactly. I got it fixed for our build, but it seems that the current fix in the Celero CMake file didn't work for me.

from celero.

DigitalInBlue avatar DigitalInBlue commented on August 17, 2024

Ok. Can you push your fix up? Sorry. I don't use it statically and didn't know it was broken still.

from celero.

MichaelMauderer avatar MichaelMauderer commented on August 17, 2024

I only fixed the issue locally by adding a target_link_libraries(PROJECTNAME PowrProf.lib) to our build. I am not sure why the one from the Celero CMakeLists.txt did not do the job though.

from celero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.