Skip to content

References to tbb-NOTFOUND.obj #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
abergmeier-dsfishlabs opened this issue Jan 11, 2017 · 7 comments
Open

References to tbb-NOTFOUND.obj #8

abergmeier-dsfishlabs opened this issue Jan 11, 2017 · 7 comments

Comments

@abergmeier-dsfishlabs
Copy link

When I try to use TBB with my CMake project like this:

list(APPEND CMAKE_MODULE_PATH "<path to FindTBB module>")

find_package(TBB REQUIRED)

add_executable(myapp myapp.cc)
target_link_libraries(myapp tbb)

It in the end tries to link tbb-NOTFOUND.obj (which of course fails).

@justusc
Copy link
Owner

justusc commented Jan 11, 2017

Thank you for the bug report. Can you also provide the arguments you used when you invoked cmake, OS, and compiler? So I can try to reproduce your error.

@abergmeier-dsfishlabs
Copy link
Author

Am compiling with VS2015 on Windows 10.

In the .vcxproj I have the following entry:

<Link>
  <AdditionalOptions> /machine:x64"%3B"/NODEFAULTLIB:msvcrt.lib"%3B"/NODEFAULTLIB:libcmt.lib"%3B"/NODEFAULTLIB:libcmtd.lib %(AdditionalOptions)</AdditionalOptions>
  <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;tbb-NOTFOUND

Not sure yet, where this comes from. Would guess find_package_handle_standard_args.

@abergmeier-dsfishlabs
Copy link
Author

@abergmeier-dsfishlabs
Copy link
Author

Switched add_library to static and seems to work for DEBUG and RELEASE at least. RELWITHDEBINFO cannot link tbb.lib, though.

@justusc
Copy link
Owner

justusc commented Jan 12, 2017

Yes, the SO post looks like a likely source of the error.

@justusc
Copy link
Owner

justusc commented Jan 12, 2017

I will look into the error this weekend.

@abergmeier-dsfishlabs
Copy link
Author

abergmeier-dsfishlabs commented Jan 13, 2017

Problem with RELWITHDEBINFO seems to be that there is no _DEBUG defined and then TBB in _tbb_windef.h and runtime_loader.h decides to implicitly link with tbb.lib.
Sadly only setting __TBB_LIB_NAME does not fix the behavior. You probably have to set __TBB_NO_IMPLICIT_LINKAGE to 1 to disable implicit linking completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants