fynv / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

NVCore/Debug.cpp fails to compile in Mac OS X #180

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using r1355 on Mac OS X 10.8.1 with Xcode 4.4.1 using Apple LLVM compiler 
4.1.

While trying to build the NVCore library, compiling fails on Debug.cpp with 
numerous errors (see full compile log below).

I believe the problems arise out of the fact that many variables are defined in 
sections intended for Windows, and then those variables are referenced in the 
*nix/Darwin/OSX sections.

Xcode output:

Build target NVCore

CompileC 
/Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdno
jemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/Obje
cts-normal/x86_64/Debug.o ../../src/nvcore/Debug.cpp normal x86_64 c++ 
com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/mdouma46/Developer/NVTextureTools/project/osx
    setenv LANG en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -std=gnu++11 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-sign-compare -Wshorten-64-to-32 -Wno-newline-eof -Wc++11-extensions -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fasm-blocks -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.8 -g -fvisibility-inlines-hidden -Wno-sign-conversion -iquote /Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/NVCore-generated-files.hmap -I/Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/NVCore-own-target-headers.hmap -I/Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/NVCore-all-target-headers.hmap -iquote /Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/NVCore-project-headers.hmap -I/Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Products/Debug/include -I/Users/mdouma46/Developer/NVTextureTools/project/osx/../../extern/poshlib -I/Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/DerivedSources/x86_64 -I/Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/DerivedSources -F/Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Products/Debug -MMD -MT dependencies -MF /Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/Objects-normal/x86_64/Debug.d --serialize-diagnostics /Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/Objects-normal/x86_64/Debug.dia -c /Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp -o /Users/mdouma46/Library/Developer/Xcode/DerivedData/NVTextureTools-baawfqiuzhdnojemgnskfobevjxd/Build/Intermediates/NVTextureTools.build/Debug/NVCore.build/Objects-normal/x86_64/Debug.o

/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
821:27: error: use of undeclared identifier 's_handler_critical_section'
    EnterCriticalSection(&s_handler_critical_section);
                          ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
823:5: error: use of undeclared identifier 'writeMiniDump'
    writeMiniDump(NULL);
    ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
833:9: error: use of undeclared identifier 'writeStackTrace'
        writeStackTrace(trace, size, 0, lines);
        ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
845:27: error: use of undeclared identifier 's_handler_critical_section'
    LeaveCriticalSection(&s_handler_critical_section);
                          ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
875:9: error: use of undeclared identifier 'writeStackTrace'
        writeStackTrace(trace, size, 1, lines);
        ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
878:21: warning: format string is not a string literal (potentially insecure) 
[-Wformat-security]
            nvDebug(lines[i]);
            ~~~~~~~~^~~~~~~~~
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.h:14
3:38: note: expanded from macro 'nvDebug'
#define nvDebug(...)    nvDebugPrint(__VA_ARGS__)
                                     ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
922:32: error: use of undeclared identifier 's_handler_critical_section'
    InitializeCriticalSection(&s_handler_critical_section);
                               ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
924:5: error: use of undeclared identifier 's_handler_start_semaphore'
    s_handler_start_semaphore = CreateSemaphore(NULL, 0, 1, NULL);
    ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
924:33: error: use of undeclared identifier 'CreateSemaphore'
    s_handler_start_semaphore = CreateSemaphore(NULL, 0, 1, NULL);
                                ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
925:18: error: use of undeclared identifier 's_handler_start_semaphore'
    nvDebugCheck(s_handler_start_semaphore != NULL);
                 ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.h:10
4:44: note: expanded from macro 'nvDebugCheck'
#   define nvDebugCheck(exp)    nvNoAssert(exp)
                                           ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.h:21
:18: note: expanded from macro 'nvNoAssert'
    (void)sizeof(exp); \
                 ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
927:5: error: use of undeclared identifier 's_handler_finish_semaphore'
    s_handler_finish_semaphore = CreateSemaphore(NULL, 0, 1, NULL);
    ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
927:34: error: use of undeclared identifier 'CreateSemaphore'
    s_handler_finish_semaphore = CreateSemaphore(NULL, 0, 1, NULL);
                                 ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
928:18: error: use of undeclared identifier 's_handler_finish_semaphore'
    nvDebugCheck(s_handler_finish_semaphore != NULL);
                 ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.h:10
4:44: note: expanded from macro 'nvDebugCheck'
#   define nvDebugCheck(exp)    nvNoAssert(exp)
                                           ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.h:21
:18: note: expanded from macro 'nvNoAssert'
    (void)sizeof(exp); \
                 ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
931:9: error: use of undeclared identifier 's_handler_finish_semaphore'
    if (s_handler_finish_semaphore != NULL && s_handler_start_semaphore != NULL) {
        ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
931:47: error: use of undeclared identifier 's_handler_start_semaphore'
    if (s_handler_finish_semaphore != NULL && s_handler_start_semaphore != NULL) {
                                              ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
932:9: error: use of undeclared identifier 'DWORD'
        DWORD thread_id;
        ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
933:9: error: use of undeclared identifier 's_handler_thread'
        s_handler_thread = CreateThread(NULL,         // lpThreadAttributes
        ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
935:41: error: use of undeclared identifier 'ExceptionHandlerThreadMain'
                                        ExceptionHandlerThreadMain,
                                        ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.cpp:
939:22: error: use of undeclared identifier 's_handler_thread'
        nvDebugCheck(s_handler_thread != NULL);
                     ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.h:10
4:44: note: expanded from macro 'nvDebugCheck'
#   define nvDebugCheck(exp)    nvNoAssert(exp)
                                           ^
/Users/mdouma46/Developer/NVTextureTools/project/osx/../../src/nvcore/Debug.h:21
:18: note: expanded from macro 'nvNoAssert'
    (void)sizeof(exp); \
                 ^
1 warning and 18 errors generated.

Note, the following is the contents of my nvconfig.h file:

#ifndef NV_CONFIG
#define NV_CONFIG

#define HAVE_UNISTD_H
#define HAVE_STDARG_H
#define HAVE_SIGNAL_H
#define HAVE_EXECINFO_H
//#define HAVE_MALLOC_H

#define HAVE_OPENMP
#define HAVE_DISPATCH_H

// #define HAVE_STBIMAGE
//#define HAVE_PNG
//#define HAVE_JPEG
//#define HAVE_TIFF
//#define HAVE_OPENEXR
//#define HAVE_FREEIMAGE

//#define HAVE_MAYA

#endif // NV_CONFIG

---------------------------------

Original issue reported on code.google.com by markdoum...@gmail.com on 11 Sep 2012 at 10:18

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1356.

Original comment by cast...@gmail.com on 11 Sep 2012 at 4:22

GoogleCodeExporter commented 9 years ago
I don't have 10.8, but I hope my recent changes fix this. Re-open if that's not 
the case. Thanks!

Original comment by cast...@gmail.com on 11 Sep 2012 at 4:29