I have some cpp files that I would like to use in python. I tried to compile it with cython, however I'm getting some errors.It's worth noticing the cpp code compiles fine in the same machine with CXX flags set.
For instance, the following constructor gives me an error:
error: expected member name or ';' after declaration specifiers
affine(float _angle,float _tilt):angle{_angle},tilt{_tilt}{}
Can someone provide an example of how to set this up using Cython?
Thanks.
Related
I am trying to compile a C program using CeGCC, the program is written in C using Win32 API, and it's being compiled with MingW like this:
gcc -o "Win32App.exe" obj/winmain.o obj/callbacks.o obj/resource.o -s -lcomctl32 -Wl,--subsystem,windows
As a result the program is successfully compiled and then tested afterwards. The problem occurs when i try to compile it for ARM (Windows-CE) rather than x86-based architecture:
obj/winmain.o:winmain.c:(.text+0x24): undefined reference to InitCommonControlsEx
obj/winmain.o:winmain.c:(.text+0xe0): undefined reference to RegisterClassExW
As you can see the problem is that the two functions called InitCommonControlsEx and RegisterClassExW are not defined in Windows-CE.
My Question is how can i find an equivalent function to use in my code so that i can successfully compile and run my program in Windows-CE. I need help in replacing those two functions with compatible ones which are recognized in CeGCC.
I am trying to to compile wxWidgets 3.0.2 found here.
I need this library, so that I can compile SimSpark.
I have tried installing the library via MacPorts - this does work. But when I try to compile SimSpark, the compiler states the following:
In file included from /opt/local/include/gcc49/c++/type_traits:35:0,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/strvararg.h:25,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/string.h:46,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/memory.h:15,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/object.h:19,
from /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0/wx/event.h:16,
from /Users/YEED/Downloads/simspark-0.2.4/plugin/inputwx/inputwx.cpp:23:
/opt/local/include/gcc49/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
I believe that I need to compile wxWidgets with C++11 support, since I already included the C++11 relevant flags when making SimSpark.
When I try to compile wxWidgets, I get a bunch of compiler errors that refer to the same .h file - which is part of CoreFoundation:
In file included from /usr/include/Availability.h:184:0,
from /usr/include/stdlib.h:61,
from /usr/include/assert.h:44,
from ../include/wx/debug.h:13,
from ../include/wx/defs.h:743,
from ../include/wx/wxprec.h:12,
from ../src/common/filefn.cpp:20:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:53:34: error: expected '}' before '__attribute__'
kCFISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = (1UL << 0),
When you look into that specific file, there are a bunch of lines that miss a closing ) and resemble the one printed by the compiler as well. (There should be a closing ) before the comma at the end of the line, right?)
So my question is, is this an actual error in CoreFoundation? If so, how can I fix this or work around it? Or am I actually completely misunderstanding the compiler error thrown when compiling SimSpark in the first place?
EDIT:
I couldn't get wxWidgets to compile, but I have fixed my issues compiling SimSpark with the MacPorts version of wxWidgets. The problem lay within using different compilers (gcc and clang) for the two.
I'm trying to implement a certain pre-compilation effect on objective-C code (explained here). I've managed to get a custom compiler in place in Xcode 5 following these helpful instructions. However my passthru attempt to clang results in an error:
My custom compiler's executable:
#!/bin/bash
clang "$#"
Error message:
While building module 'UIKit' imported from /Users/Club15CC/Google Drive/Code/Frogger/Frogger/Frogger-Prefix.pch:14:
...
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:33:1:
error: use of empty enum
};
^
/Users/Club15CC/Google Drive/Code/Frogger/Frogger/Frogger-Prefix.pch:14:13: fatal error: could not build module 'UIKit'
#import <UIKit/UIKit.h>
~~~~~~~^
2 errors generated.
Command /usr/bin/frogger failed with exit code 1
Note the executable is called frogger and the test Xcode project Frogger.
It builds fine with the default compiler. Does the enum error imply some flag isn't being passed through? Does bash have a limit to the size of $#? The compiler invoking string is rather long and perhaps is being truncated?
Thanks for any help...
---- UPDATE ----
It seems as though it's passing the wrong "minimum version" flag to the custom compiler: The normal LLVM compiler has this flag: -mios-simulator-version-min=7.0 while my custom one is getting this flag: -mmacosx-version-min=10.6 - which is the cause of the UIDevice error. The correct flags are handled inside of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/Native Build System.xcspec and the equivalent one for iOS as opposed to simulator. It seems somehow my custom compilers not picking up these specs. I'm in over my head here!
I've just installed trilinos 11.0.3 and now I'm trying to compile my first application using cmake.
The file I'm trying to compile is here
http://code.google.com/p/trilinos/wiki/EpetraSimpleVector
The first command cmake seems to work although I get the following warnings (just in case its relevant) for each trilinos package:
CMake Warning (dev) at /home/giorgos/Documents/TRILINOS/lib/cmake/Trilinos/
TrilinosTargets.cmake:208 (ADD_LIBRARY):
ADD_LIBRARY called with SHARED option but the target platform does not
support dynamic linking. Building a STATIC library instead. This may lead
to problems.
Other than that it seems that the location of trilinos includes and libraries have been found correctly
However the make command produce a list of similar errors such as :
/home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:11:
undefined reference to `Epetra_SerialComm::Epetra_SerialComm()'
/home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:16:
undefined reference to `Epetra_Map::Epetra_Map(int, int, Epetra_Comm const&)'
/home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:19:
undefined reference to `Epetra_Vector::Epetra_Vector(Epetra_BlockMap const&, bool)'
/home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:20:
undefined reference to `Epetra_Vector::Epetra_Vector(Epetra_BlockMap const&, bool)'
Any idea what's going on here?
(I named the source file teuchos_test.cpp because first I tried to compile some code from the teuchos package, However I was receiving similar errors as above)
Thank you
Giorgos
You can use cmake or make to build your program with Trilinos. I refer you to the official tutorial website here, which provides detailed explanations for both methods.
I haven't been able to compile the trilinos examples with cmake but I was able to do so by linking everything my self. For the example that gives me the above errors I did the following
g++ -o teuchos_test teuchos_test.cpp \
-I/home/giorgos/Documents/TRILINOS/include \
-L/home/giorgos/Documents/TRILINOS/lib -lepetra
since it depends on the epetra package only (I still have to change the name :))
However if anyone knows how to compile trilinos with cmake I'd appreciate the input here
I am trying to compile Ruby on HPUX but get the following:
cc: "transcode.c", line 1489: error 1588: "SIZE_MAX" undefined.
cc: "transcode.c", line 1489: error 1563: Expression in if must be scalar.
I had a problem with SIZE_MAX being undefined using aCC compiler without the C99 flag. Using this environment option in the ./configure got me past it, but I'm hitting other problems later on (miniruby compiles and links, but throws a Bus Error when the make process continues :-/). Does this help you build?
CC="cc -AC99" CPPFLAGS="-D_HPUX_SOURCE" ./configure
What HPUX and compiler version?
If I remember correctly SIZE_MAX is only available if you use c99 compiler and include stdint.h (not limits.h).