I tried to complile the main.c in Nuklear/demo/d3d11/ (https://github.com/Immediate-Mode-UI/Nuklear/tree/master/demo/d3d11) with gcc on the commend prompt, namely using
gcc main.c -luser32 -ldxguid -ld3d11
It works perfectly.
It works using the "build.bat" too.
However, when I tried to use any of these (also changed the file name to main.cpp if needed)
g++ main.c -luser32 -ldxguid -ld3d11
gcc main.cpp -luser32 -ldxguid -ld3d11
g++ main.cpp -luser32 -ldxguid -ld3d11
It produced a huge amount of "was not declared in this scope" errors.
In file included from main.c:30:
nuklear_d3d11.h: In function 'void nk_d3d11_render(ID3D11DeviceContext*, nk_anti_aliasing)':
nuklear_d3d11.h:101:5: error: 'ID3D11DeviceContext_IASetInputLayout' was not declared in this scope
nuklear_d3d11.h:102:5: error: 'ID3D11DeviceContext_IASetVertexBuffers' was not declared in this scope
nuklear_d3d11.h:103:5: error: 'ID3D11DeviceContext_IASetIndexBuffer' was not declared in this scope
nuklear_d3d11.h:104:5: error: 'ID3D11DeviceContext_IASetPrimitiveTopology' was not declared in this scope
nuklear_d3d11.h:106:5: error: 'ID3D11DeviceContext_VSSetShader' was not declared in this scope
nuklear_d3d11.h:107:5: error: 'ID3D11DeviceContext_VSSetConstantBuffers' was not declared in this scope
nuklear_d3d11.h:109:5: error: 'ID3D11DeviceContext_PSSetShader' was not declared in this scope
nuklear_d3d11.h:110:5: error: 'ID3D11DeviceContext_PSSetSamplers' was not declared in this scope
nuklear_d3d11.h:112:5: error: 'ID3D11DeviceContext_OMSetBlendState' was not declared in this scope
nuklear_d3d11.h:113:5: error: 'ID3D11DeviceContext_RSSetState' was not declared in this scope
nuklear_d3d11.h:114:5: error: 'ID3D11DeviceContext_RSSetViewports' was not declared in this scope
nuklear_d3d11.h:124:10: error: 'ID3D11DeviceContext_Map' was not declared in this scope; did you mean 'ID3D11DeviceContext'?
nuklear_d3d11.h:156:5: error: 'ID3D11DeviceContext_Unmap' was not declared in this scope; did you mean 'ID3D11DeviceContext'?
nuklear_d3d11.h:171:9: error: 'ID3D11DeviceContext_PSSetShaderResources' was not declared in this scope
nuklear_d3d11.h:172:9: error: 'ID3D11DeviceContext_RSSetScissorRects' was not declared in this scope
nuklear_d3d11.h:173:9: error: 'ID3D11DeviceContext_DrawIndexed' was not declared in this scope
In file included from D:/OtherProgramFiles/msys64/mingw64/include/winbase.h:2682,
from D:/OtherProgramFiles/msys64/mingw64/include/windows.h:70,
from main.c:7:
nuklear_d3d11.h: In function 'void nk_d3d11_resize(ID3D11DeviceContext*, int, int)':
nuklear_d3d11.h:205:19: error: 'ID3D11DeviceContext_Map' was not declared in this scope; did you mean 'ID3D11DeviceContext'?
nuklear_d3d11.h:208:9: error: 'ID3D11DeviceContext_Unmap' was not declared in this scope; did you mean 'ID3D11DeviceContext'?
nuklear_d3d11.h: In function 'nk_context* nk_d3d11_init(ID3D11Device*, int, int, unsigned int, unsigned int)':
nuklear_d3d11.h:444:5: error: 'ID3D11Device_AddRef' was not declared in this scope
nuklear_d3d11.h:466:10: error: 'ID3D11Device_CreateRasterizerState' was not declared in this scope
nuklear_d3d11.h:470:11: error: 'ID3D11Device_CreateVertexShader' was not declared in this scope
nuklear_d3d11.h:479:10: error: 'ID3D11Device_CreateInputLayout' was not declared in this scope
nuklear_d3d11.h:498:10: error: 'ID3D11Device_CreateBuffer' was not declared in this scope
nuklear_d3d11.h:502:11: error: 'ID3D11Device_CreatePixelShader' was not declared in this scope
nuklear_d3d11.h:517:10: error: 'ID3D11Device_CreateBlendState' was not declared in this scope
nuklear_d3d11.h:528:10: error: 'ID3D11Device_CreateBuffer' was not declared in this scope
nuklear_d3d11.h:538:10: error: 'ID3D11Device_CreateBuffer' was not declared in this scope
nuklear_d3d11.h:552:10: error: 'ID3D11Device_CreateSamplerState' was not declared in this scope
nuklear_d3d11.h: In function 'void nk_d3d11_font_stash_end()':
nuklear_d3d11.h:600:10: error: 'ID3D11Device_CreateTexture2D' was not declared in this scope
nuklear_d3d11.h:609:10: error: 'ID3D11Device_CreateShaderResourceView' was not declared in this scope; did you mean 'ID3D11ShaderResourceView'?
nuklear_d3d11.h:611:5: error: 'ID3D11Texture2D_Release' was not declared in this scope; did you mean 'ID3D11Texture2D'?
nuklear_d3d11.h: In function 'void nk_d3d11_shutdown()':
nuklear_d3d11.h:625:5: error: 'ID3D11SamplerState_Release' was not declared in this scope; did you mean 'ID3D11SamplerState'?
nuklear_d3d11.h:626:5: error: 'ID3D11ShaderResourceView_Release' was not declared in this scope; did you mean 'ID3D11ShaderResourceView'?
nuklear_d3d11.h:627:5: error: 'ID3D11Buffer_Release' was not declared in this scope
nuklear_d3d11.h:629:5: error: 'ID3D11BlendState_Release' was not declared in this scope; did you mean 'ID3D11BlendState'?
nuklear_d3d11.h:630:5: error: 'ID3D11PixelShader_Release' was not declared in this scope; did you mean 'ID3D11PixelShader'?
nuklear_d3d11.h:632:5: error: 'ID3D11VertexShader_Release' was not declared in this scope; did you mean 'ID3D11VertexShader'?
nuklear_d3d11.h:633:5: error: 'ID3D11InputLayout_Release' was not declared in this scope; did you mean 'ID3D11InputLayout'?
nuklear_d3d11.h:634:5: error: 'ID3D11RasterizerState_Release' was not declared in this scope; did you mean 'ID3D11RasterizerState'?
nuklear_d3d11.h:635:5: error: 'ID3D11Device_Release' was not declared in this scope
main.c: In function 'void set_swap_chain_size(int, int)':
main.c:89:9: error: 'ID3D11RenderTargetView_Release' was not declared in this scope; did you mean 'ID3D11RenderTargetView'?
main.c:91:5: error: 'ID3D11DeviceContext_OMSetRenderTargets' was not declared in this scope
main.c:93:10: error: 'IDXGISwapChain_ResizeBuffers' was not declared in this scope
main.c:106:10: error: 'IDXGISwapChain_GetBuffer' was not declared in this scope
main.c:109:10: error: 'ID3D11Device_CreateRenderTargetView' was not declared in this scope
main.c:112:5: error: 'ID3D11Texture2D_Release' was not declared in this scope; did you mean 'ID3D11Texture2D'?
main.c: In function 'int main()':
main.c:294:9: error: 'ID3D11DeviceContext_ClearRenderTargetView' was not declared in this scope
main.c:295:9: error: 'ID3D11DeviceContext_OMSetRenderTargets' was not declared in this scope
main.c:297:14: error: 'IDXGISwapChain_Present' was not declared in this scope; did you mean 'IDXGISwapChain'?
main.c:309:5: error: 'ID3D11DeviceContext_ClearState' was not declared in this scope
main.c:311:5: error: 'ID3D11RenderTargetView_Release' was not declared in this scope; did you mean 'ID3D11RenderTargetView'?
main.c:312:5: error: 'ID3D11DeviceContext_Release' was not declared in this scope; did you mean 'ID3D11DeviceContext'?
main.c:313:5: error: 'ID3D11Device_Release' was not declared in this scope
main.c:314:5: error: 'IDXGISwapChain_Release' was not declared in this scope; did you mean 'IDXGISwapChain'?
All four commends work if I replace main.c/main.cpp with a simple hello world script (in C, also in C++ if I add "-lstdc++").
I think all of the errors come from things in msys64\mingw64\include\d3d11.h. It may be a linking problem. But the headers are included correctly otherwise "gcc main.c" won't works. I also tried to use "extern "C" {}", but it also didn't work.
I have tried to use Visual Studio commend prompt, Visual Studio Code and commend prompt in Windows. All have the same result.
As I want to use C++ with Nuklear, how can I do it with g++?
Related
I have a simple C++ program that imports cmath.
#include <cmath>
int main() {
return 0;
}
I'm trying to compile it using the following command.
clang++ -o test main.cpp -std=c++14
But, I get the following errors
In file included from main.cpp:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error:
no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error:
no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error:
no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
~~^
/usr/local/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
^
In file included from main.cpp:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:320:9: error:
no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:321:9: error:
no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:322:9: error:
no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:323:9: error:
no member named 'isgreater' in the global namespace
using ::isgreater;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:324:9: error:
no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:325:9: error:
no member named 'isless' in the global namespace
using ::isless;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:326:9: error:
no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:327:9: error:
no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:328:9: error:
no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error:
no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:335:9: error:
no member named 'abs' in the global namespace; did you mean 'fabs'?
using ::abs;
~~^
/usr/local/include/math.h:417:15: note: 'fabs' declared here
extern double fabs(double);
^
In file included from main.cpp:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:26: error:
no template named 'numeric_limits'
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:60: error:
no template named 'numeric_limits'
bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:18: error:
no template named 'numeric_limits'
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:50: error:
no template named 'numeric_limits'
int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:646:17: error:
no template named 'numeric_limits'
static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix");
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Here are my system specifications.
macOS Catalina Version 10.15.2
Apple clang version 11.0.3 (clang-1103.0.32.29)
Xcode Version 11.4 (11E146) (not sure if this matters)
Thanks for any assistance!
EDIT: Updated to macOS 10.15.4 and Xcode 11.4.1 and still have the same issue
I believe this is answered at Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace
The easiest solution seems to be to uninstall the Command Line Tools, which works on Catalina, but I was hitting this on High Sierra, where I resorted to editing /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath
to comment out #include <math.h> and replace it with:
#include</Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h>
I had to do this to get homebrew's Rust (rustc-1.53.0) to compile on High Sierra. Probably a better approach would be to tell cmake:
set(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk)
since it's not usually a great idea to mess with the system-supplied headers.
I'm trying to install RMagick 2.15.4 on RHEL 6.7 using Ruby 2.0.0 and ImageMagick 7.0.2.
I've installed ImageMagick7, ImageMagick7-c++, ImageMagick7-c++-devel, ImageMagick7-devel, ImageMagick7-libs packages, made a symlinks:
ln -s /usr/include/ImageMagick-7/MagickCore/ /usr/include/ImageMagick-7/magick
ln -s /usr/include/ImageMagick-7/MagickWand/ /usr/include/ImageMagick-7/wand
And launched install:
C_INCLUDE_PATH=/usr/include/ImageMagick-7/ gem install rmagick
But got this errors:
======================================================================
Thu 16Jun16 05:08:41
This installation of RMagick 2.15.4 is configured for
Ruby 2.0.0 (x86_64-linux) and ImageMagick 7.0.2
======================================================================
Configured compile options: {:magick_config=>false, :pkg_config=>true, :magick_version=>"7.0.2", :local_libs=>" -lMagickCore-7.Q16HDRI ", :cflags=>" -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-7 ", :cppflags=>" -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-7 ", :ldflags=>" -lMagickCore-7.Q16HDRI ", :defs=>[], :config_h=>"Makefile rmagick.h"}
make "DESTDIR="
compiling rmmontage.c
In file included from rmmontage.c:14:
rmagick.h:1210: error: expected declaration specifiers or ‘...’ before ‘MagickPixelPacket’
rmagick.h:1219: warning: parameter names (without types) in function declaration
rmagick.h:1224: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
rmagick.h:1240: warning: parameter names (without types) in function declaration
rmagick.h:1253: warning: parameter names (without types) in function declaration
rmagick.h:1289: error: expected declaration specifiers or ‘...’ before ‘MagickPixelPacket’
rmmontage.c: In function ‘Montage_background_color_eq’:
rmmontage.c:110: warning: passing argument 1 of ‘Color_to_PixelPacket’ from incompatible pointer type
rmagick.h:1209: note: expected ‘struct PixelPacket *’ but argument is of type ‘struct PixelInfo *’
rmmontage.c: In function ‘Montage_border_color_eq’:
rmmontage.c:131: warning: passing argument 1 of ‘Color_to_PixelPacket’ from incompatible pointer type
rmagick.h:1209: note: expected ‘struct PixelPacket *’ but argument is of type ‘struct PixelInfo *’
rmmontage.c: In function ‘Montage_fill_eq’:
rmmontage.c:215: warning: passing argument 1 of ‘Color_to_PixelPacket’ from incompatible pointer type
rmagick.h:1209: note: expected ‘struct PixelPacket *’ but argument is of type ‘struct PixelInfo *’
rmmontage.c: In function ‘Montage_matte_color_eq’:
rmmontage.c:353: error: ‘MontageInfo’ has no member named ‘matte_color’
rmmontage.c: In function ‘Montage_stroke_eq’:
rmmontage.c:416: warning: passing argument 1 of ‘Color_to_PixelPacket’ from incompatible pointer type
rmagick.h:1209: note: expected ‘struct PixelPacket *’ but argument is of type ‘struct PixelInfo *’
make: *** [rmmontage.o] Error 1
I checked all developer dependencies on https://rubygems.org/gems/rmagick/versions/2.15.4, and they was satisfied.
How to fix this?
Thanks.
I'm trying to install bochs emulator on mac machine which runs mac osx 10.8.3 But when I run the ./configure and make
I get the following error at the end of the make
carbon.cc:1318: error: ‘PaletteHandle’ was not declared in this scope
carbon.cc:1318: error: expected `;' before ‘thePal’
carbon.cc:1329: error: ‘RGBDirect’ was not declared in this scope
carbon.cc:1331: error: ‘GetPort’ was not declared in this scope
carbon.cc:1339: error: ‘SetEntries’ was not declared in this scope
carbon.cc:1341: error: ‘CTabChanged’ was not declared in this scope
carbon.cc:1343: error: ‘SetPort’ was not declared in this scope
carbon.cc:1350: error: ‘thePal’ was not declared in this scope
carbon.cc:1350: error: ‘pmTolerant’ was not declared in this scope
carbon.cc:1350: error: ‘NewPalette’ was not declared in this scope
carbon.cc:1351: error: ‘oldpal’ was not declared in this scope
carbon.cc:1351: error: ‘GetPalette’ was not declared in this scope
carbon.cc:1353: error: ‘SetPalette’ was not declared in this scope
carbon.cc:1359: error: ‘RGBDirect’ was not declared in this scope
carbon.cc: In member function ‘virtual void bx_carbon_gui_c::graphics_tile_update(Bit8u*, unsigned int, unsigned int)’:
carbon.cc:1397: error: ‘GetPort’ was not declared in this scope
carbon.cc:1400: error: ‘OffsetRect’ was not declared in this scope
carbon.cc:1403: error: ‘LockPortBits’ was not declared in this scope
carbon.cc:1405: error: ‘GetPixBaseAddr’ was not declared in this scope
carbon.cc:1409: error: ‘GetPixRowBytes’ was not declared in this scope
carbon.cc:1418: error: ‘GetPixRowBytes’ was not declared in this scope
carbon.cc:1420: error: ‘UnlockPortBits’ was not declared in this scope
carbon.cc:1422: error: ‘RGBForeColor’ was not declared in this scope
carbon.cc:1423: error: ‘RGBBackColor’ was not declared in this scope
carbon.cc:1424: error: ‘GetPortBitMapForCopyBits’ was not declared in this scope
carbon.cc:1425: error: ‘CopyBits’ was not declared in this scope
carbon.cc:1426: error: ‘QDError’ was not declared in this scope
carbon.cc:1428: error: ‘SetPort’ was not declared in this scope
carbon.cc: In member function ‘virtual void bx_carbon_gui_c::dimension_update(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)’:
carbon.cc:1459: error: ‘DisposeGWorld’ was not declared in this scope
carbon.cc:1461: error: ‘GetCTable’ was not declared in this scope
carbon.cc: In member function ‘virtual unsigned int bx_carbon_gui_c::create_bitmap(const unsigned char*, unsigned int, unsigned int)’:
carbon.cc:1529: warning: ‘GetCIcon’ is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h:308)
carbon.cc:1529: warning: ‘GetCIcon’ is deprecated (declared at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h:308)
carbon.cc: In member function ‘virtual unsigned int bx_carbon_gui_c::headerbar_bitmap(unsigned int, unsigned int, void (*)())’:
carbon.cc:1582: error: ‘SetRect’ was not declared in this scope
carbon.cc: In member function ‘virtual void bx_carbon_gui_c::exit()’:
carbon.cc:1641: error: ‘InitCursor’ was not declared in this scope
carbon.cc:1644: warning: ‘CallInScrapPromises’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Scrap.h:649)
carbon.cc:1644: warning: ‘CallInScrapPromises’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Scrap.h:649)
carbon.cc: In function ‘void HidePointer()’:
carbon.cc:1678: error: ‘HideCursor’ was not declared in this scope
carbon.cc:1680: error: ‘SetPt’ was not declared in this scope
carbon.cc:1681: error: ‘LocalToGlobal’ was not declared in this scope
carbon.cc:1683: warning: ‘GetMouse’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Events.h:384)
carbon.cc:1683: warning: ‘GetMouse’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Events.h:384)
carbon.cc: In function ‘void ShowPointer()’:
carbon.cc:1694: error: ‘InitCursor’ was not declared in this scope
carbon.cc: In function ‘void UpdateTools()’:
carbon.cc:1708: warning: ‘GetCurrentScrap’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Scrap.h:263)
carbon.cc:1708: warning: ‘GetCurrentScrap’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Scrap.h:263)
carbon.cc:1712: warning: ‘GetScrapFlavorFlags’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Scrap.h:293)
carbon.cc:1712: warning: ‘GetScrapFlavorFlags’ is deprecated (declared at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Scrap.h:293)
carbon.cc: In function ‘void CreateKeyMap()’:
carbon.cc:1996: warning: ‘NewPtrClear’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:605)
carbon.cc:1996: warning: ‘NewPtrClear’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:605)
carbon.cc: In function ‘void CreateVGAFont(unsigned char*)’:
carbon.cc:2014: error: ‘SetRect’ was not declared in this scope
carbon.cc:2021: warning: ‘NewPtrClear’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:605)
carbon.cc:2021: warning: ‘NewPtrClear’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:605)
carbon.cc: In function ‘BitMap* CreateBitMap(unsigned int, unsigned int)’:
carbon.cc:2047: error: ‘SetRect’ was not declared in this scope
carbon.cc: In member function ‘virtual void bx_carbon_gui_c::beep_on(float)’:
carbon.cc:2103: warning: ‘AlertSoundPlay’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SystemSound.h:124)
carbon.cc:2103: warning: ‘AlertSoundPlay’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SystemSound.h:124)
make[1]: *** [carbon.o] Error 1
make: *** [gui/libgui.a] Error 2
so any clue how to install the bochs on my system?
Thanks
I'm trying to learn Ruby on Rails and wanted to follow Apple's example:
http://developer.apple.com/tools/developonrailsleopard.html
It requires Ruby 1.8.6 and Rails 2.0.2
My machines is already updated to 1.9.1. I wanted to use rvm to install 1.8.6 but it failed during make with the following log:
[2010-10-20 10:43:31] make
eval.c: In function ‘rb_eval_string_wrap’:
eval.c:1743: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘rb_eval_cmd’:
eval.c:1884: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘call_trace_func’:
eval.c:2735: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘rb_raise_jump’:
eval.c:4760: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘method_missing’:
eval.c:5684: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘rb_call0’:
eval.c:5847: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘rb_f_eval’:
eval.c:6634: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘exec_under’:
eval.c:6658: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘rb_load’:
eval.c:6894: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘call_end_proc’:
eval.c:7924: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘rb_f_END’:
eval.c:7937: warning: assignment discards qualifiers from pointer target type
eval.c: In function ‘mproc’:
eval.c:9557: warning: assignment discards qualifiers from pointer target type
file.c: In function ‘lchmod_internal’:
file.c:1787: warning: cast from pointer to integer of different size
gc.c: In function ‘obj_free’:
gc.c:1287: warning: initialization from incompatible pointer type
regex.c: In function ‘ruby_re_compile_pattern’:
regex.c:1362: warning: format ‘%d’ expects type ‘int’, but argument 7 has type ‘long int’
regex.c:2026: warning: format ‘%d’ expects type ‘int’, but argument 6 has type ‘long int’
ptr.c: In function ‘rb_dlptr_inspect’:
ptr.c:461: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 7 has type ‘struct ptr_data *’
ptr.c:461: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 8 has type ‘void *’
void
char
short
int
long
float
double
sym.c: In function ‘rb_dlsym_inspect’:
sym.c:270: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 6 has type ‘struct sym_data *’
sym.c:270: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 7 has type ‘void *’
ossl_asn1.c: In function ‘decode_bool’:
ossl_asn1.c:313: warning: passing argument 2 of ‘d2i_ASN1_BOOLEAN’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_int’:
ossl_asn1.c:328: warning: passing argument 2 of ‘d2i_ASN1_INTEGER’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_bstr’:
ossl_asn1.c:347: warning: passing argument 2 of ‘d2i_ASN1_BIT_STRING’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_enum’:
ossl_asn1.c:373: warning: passing argument 2 of ‘d2i_ASN1_ENUMERATED’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_null’:
ossl_asn1.c:390: warning: passing argument 2 of ‘d2i_ASN1_NULL’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_obj’:
ossl_asn1.c:407: warning: passing argument 2 of ‘d2i_ASN1_OBJECT’ from incompatible pointer type
ossl_asn1.c: In function ‘decode_time’:
ossl_asn1.c:435: warning: passing argument 2 of ‘d2i_ASN1_TIME’ from incompatible pointer type
ossl_asn1.c: In function ‘ossl_asn1_get_asn1type’:
ossl_asn1.c:503: warning: cast to pointer from integer of different size
ossl_asn1.c: In function ‘ossl_asn1_decode0’:
ossl_asn1.c:727: warning: passing argument 1 of ‘ASN1_get_object’ from incompatible pointer type
ossl_ns_spki.c: In function ‘ossl_spki_initialize’:
ossl_ns_spki.c:67: warning: passing argument 2 of ‘d2i_NETSCAPE_SPKI’ from incompatible pointer type
ossl_ocsp.c: In function ‘ossl_ocspreq_initialize’:
ossl_ocsp.c:114: warning: passing argument 2 of ‘d2i_OCSP_REQUEST’ from incompatible pointer type
ossl_ocsp.c: In function ‘ossl_ocspres_initialize’:
ossl_ocsp.c:321: warning: passing argument 2 of ‘d2i_OCSP_RESPONSE’ from incompatible pointer type
ossl_pkcs7.c: In function ‘ossl_pkcs7si_new’:
ossl_pkcs7.c:90: warning: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_pkcs7.c: In function ‘DupPKCS7SignerPtr’:
ossl_pkcs7.c:103: warning: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_pkcs7.c: In function ‘ossl_pkcs7ri_new’:
ossl_pkcs7.c:116: warning: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_pkcs7.c: In function ‘DupPKCS7RecipientPtr’:
ossl_pkcs7.c:129: warning: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_pkey_dsa.c: In function ‘ossl_dsa_initialize’:
ossl_pkey_dsa.c:141: warning: passing argument 1 of ‘PEM_ASN1_read_bio’ from incompatible pointer type
ossl_pkey_dsa.c:141: warning: passing argument 4 of ‘PEM_ASN1_read_bio’ from incompatible pointer type
ossl_pkey_dsa.c: In function ‘ossl_dsa_to_public_key’:
ossl_pkey_dsa.c:313: warning: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_x509attr.c: In function ‘ossl_x509attr_initialize’:
ossl_x509attr.c:100: warning: passing argument 2 of ‘d2i_X509_ATTRIBUTE’ from incompatible pointer type
ossl_x509ext.c: In function ‘ossl_x509ext_initialize’:
ossl_x509ext.c:285: warning: passing argument 2 of ‘d2i_X509_EXTENSION’ from incompatible pointer type
ossl_x509name.c: In function ‘ossl_x509name_initialize’:
ossl_x509name.c:135: warning: passing argument 2 of ‘d2i_X509_NAME’ from incompatible pointer type
ossl_x509revoked.c: In function ‘ossl_x509revoked_new’:
ossl_x509revoked.c:48: warning: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
ossl_x509revoked.c: In function ‘DupX509RevokedPtr’:
ossl_x509revoked.c:64: warning: passing argument 2 of ‘ASN1_dup’ from incompatible pointer type
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
[2010-10-20 10:50:17] make
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
[2010-10-20 11:48:12] make
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
[2010-10-20 15:30:53] make
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
[2010-10-20 17:19:27] make
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [all] Error 1
Can anyone help? I'm totally lost here…
That article i 2.5 years old. I wouldn't recommend following it. If you still wants to then you could try to rvm install Ruby 1.8.7. I've never heard of any compability issues between 1.8.6 and 1.8.7.
I would instead recommend that you follow Setting up a Rails Development System on Mac OSX Snow Leopard and from there the regular Getting Started with Rails.
I'm trying to compile a file with the V8 the JavaScript Engine by Google. I installed scons and have compiled the V8 engine. But, here is where the problem lies, I stay in the V8 directory as they say and make a file named hello_world.cpp with the code:
#include <v8.h>
using namespace v8;
int main(int argc, char* argv[]) {
// Create a stack-allocated handle scope.
HandleScope handle_scope;
// Create a new context.
Persistent<Context> context = Context::New();
// Enter the created context for compiling and
// running the hello world script.
Context::Scope context_scope(context);
// Create a string containing the JavaScript source code.
Handle<String> source = String::New("'Hello' + ', World!'");
// Compile the source code.
Handle<Script> script = Script::Compile(source);
// Run the script to get the result.
Handle<Value> result = script->Run();
// Dispose the persistent context.
context.Dispose();
// Convert the result to an ASCII string and print it.
String::AsciiValue ascii(result);
printf("%s\n", *ascii);
return 0;
}
Then I compile using gcc hello_world.cpp -o libv8.a. But, when I compile it I get a skew of errors:
hello_world.cpp:1:16: error: v8.h: No such file or directory
hello_world.cpp:3: error: ‘v8’ is not a namespace-name
hello_world.cpp:3: error: expected namespace-name before ‘;’ token
hello_world.cpp: In function ‘int main(int, char**)’:
hello_world.cpp:8: error: ‘HandleScope’ was not declared in this scope
hello_world.cpp:8: error: expected `;' before ‘handle_scope’
hello_world.cpp:11: error: ‘Persistent’ was not declared in this scope
hello_world.cpp:11: error: ‘Context’ was not declared in this scope
hello_world.cpp:11: error: ‘context’ was not declared in this scope
hello_world.cpp:11: error: ‘Context’ is not a class or namespace
hello_world.cpp:15: error: ‘Context’ is not a class or namespace
hello_world.cpp:15: error: expected `;' before ‘context_scope’
hello_world.cpp:18: error: ‘Handle’ was not declared in this scope
hello_world.cpp:18: error: ‘String’ was not declared in this scope
hello_world.cpp:18: error: ‘source’ was not declared in this scope
hello_world.cpp:18: error: ‘String’ is not a class or namespace
hello_world.cpp:21: error: ‘Script’ was not declared in this scope
hello_world.cpp:21: error: ‘script’ was not declared in this scope
hello_world.cpp:21: error: ‘Script’ is not a class or namespace
hello_world.cpp:24: error: ‘Value’ was not declared in this scope
hello_world.cpp:24: error: ‘result’ was not declared in this scope
hello_world.cpp:30: error: ‘String’ is not a class or namespace
hello_world.cpp:30: error: expected `;' before ‘ascii’
hello_world.cpp:31: error: ‘ascii’ was not declared in this scope
hello_world.cpp:31: error: ‘printf’ was not declared in this scope
I don't get why it say V8.h is not declared. I already built it and I'm in its directory and I'm guessing if I get rid of that all the other errors will go away. Any suggestions?
i just believe you in that you are really inside the toplevel source directory (and since i do not have compiled v8 i only believe that libvp8.a is created in that toplevel directory):
% g++ -Iinclude hello_world.cpp -o hello_world libv8.a
it says "v8.h" is not declared because that file is inside the "include" directory and the preprocessor is not able to find it out of thin air.
furthermore: you are compiling a .cpp file with the C compiler instead of the C++ compiler.
you are using the '-o' flag wrong because it defines the name of the linked binary and thus needs a name, you do not want the output binary be named "libvp8.a"