Jump to content

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!

 

Link to comment
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.

Link to comment
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

 

Link to comment
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.

Link to comment
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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...