Jump to content
sumit_tuwien

SCV-2.0.1 Fails to compile suit with SCV_DISABLE_USING_NAMESPACES

Recommended Posts

Hello All,

SCV-2.0.1 Compiled with gcc-4.8.1 using the option -DSCV_DISABLE_USING_NAMESPACES. Fails to compile suit while using -DSCV_DISABLE_USING_NAMESPACES. Errors comes from STL library headers, mainly trait libs. Happens for both gcc-4.8.1 and clang-3.9. I use tuples.

Is that any mistake I am doing ? 

Regards,

Sumit

P.S: Tried to reproduce this with a minimal test case, but failed!

 

Share this post


Link to post
Share on other sites

Hello Sumit,

Do you mean that you specified -DSCV_DISABLE_USING_NAMESPACES explicitly when compiling the SCV library itself? The preprocessor definition SCV_DISABLE_USING_NAMESPACES is only meant for use in user applications, i.e., you need to pass when compiling your own code. See the RELEASENOTES section 2 for details. When we first prepared the SCV 2.0.1release, we didn't want to import the std namespace by default, but it caused too much trouble with existing code bases, which lead to this ugly method to opt out of it.

Share this post


Link to post
Share on other sites

Hello Torsten,

Greetings!

Actually, initially I compiled the library without -DSCV_DISABLE_USING_NAMESPACES and started getting the error while compiling the suit with -DSCV_DISABLE_USING_NAMESPACES. I thought I misunderstood those lines in RELEASENOTES and hence I recompiled the library with -DSCV_DISABLE_USING_NAMESPACES and still getting the compilation error! The compilation error is not coming when I compile the suit without -DSCV_DISABLE_USING_NAMESPACES.

I though I will be able to create a minimal reproduction easily and it did not show anything. This also indicates  that there possibly something wrong the way I am using the library.  Currently struggling with nonsensical messages from the compiler. 

I am trying to bring it down. 

Regards,

Sumit

 

Share this post


Link to post
Share on other sites

Let me be clear: You don't need to provide -DSCV_DISABLE_USING_NAMESPACES during the compilation of the SCV library itself. You only pass -DSCV_DISABLE_USING_NAMESPACES once you compile your application and link it to the SCV library.

Share this post


Link to post
Share on other sites

Hello Torsten,

I confirm you that I am using library where I am not providing -DSCV_DISABLE_USING_NAMESPACES during the compilation of the SCV library itself. I am using DSCV_DISABLE_USING_NAMESPACES while compiling my user code.

At this point of time, after some blind commenting/uncommening in my code, lastly I found that the source of the problem is a header file which is included from a very "infamous" C library. 

Earlier, we had some issues with scv include (scv-2.0.a), when this library defined a macro

# define std::printf SOMETHING_I_DO_NOT_WANT_TO_DISCLOSE

which I had to undef after the inclusion of this file. Again the issue is coming from here now! I will have to do further debug.

Strange thing is that, last time it was easy to find the issue because of meaningful compiler message. But this time the compiler messages does not make any sense.

Regards,

Sumit

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×