Windows linux conversion...compatible

This is a discussion on Windows linux conversion...compatible within the C++ Programming forums, part of the General Programming Boards category; Hi I am working on acode that runs on visual studio 2005.but Since I am supposed to work on Linux..I ...

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    35

    Windows linux conversion...compatible

    Hi
    I am working on acode that runs on visual studio 2005.but Since I am supposed to work on Linux..I am having compatibilty issues.
    I keep getting errors (which I know is normal) but I kdont know how make or get ride of these...
    Any help or link to give insight would be helpful.
    If needed i could post the errors and files that give them..
    Ex :errors:sqrtf not delared,ceilf not declared,
    Code:
    circle.cpp: In member function `void Circle::Rasterize(Image&)':
    circle.cpp:7: error: no match for 'operator+' in '((Circle*)this)->Circle::center + V2D(((Circle*)this)->Circle::r, ((Circle*)this)->Circle::r)'
    v2d.h:15: note: candidates are: V2D V2D::operator+(V2D&)
    circle.cpp:8: error: no match for 'operator+' in '((Circle*)this)->Circle::center + V2D((-((Circle*)this)->Circle::r), (-((Circle*)this)->Circle::r))'
    v2d.h:15: note: candidates are: V2D V2D::operator+(V2D&)
    segment.cpp: In member function `void Segment::Rasterize(Image&)':
    segment.cpp:17: error: `fabsf' was not declared in this scope
    segment.cpp:21: error: `ceilf' was not declared in this scope
    segment.cpp:24: error: `ceilf' was not declared in this scope
    segment.cpp:33: error: no match for 'operator+' in '((Segment*)this)->Segment::eps[0] + (&dxdy)->V2D::operator*(#`float_expr' not supported by dump_expr#<expression error>)'
    v2d.h:15: note: candidates are: V2D V2D::operator+(V2D&)
    Thanks
    for any help
    shweta
    Last edited by Salem; 08-27-2007 at 12:30 AM. Reason: tagged the error messages

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    Make the reference argument of operator+ const. Make the operator itself a free function that takes two const V2D& parameters. Implement it in terms of +=, which should be a member function. In fact, get rid of the implementation and use Boost.Operators instead.

    Hmm ... what else ...

    Try referring to the math functions with the std:: prefix.


    I'm moving this to the general programming board. This has nothing to do with Linux and everything with one compiler accepting incorrect code and the other refusing.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    35
    Thanks! Will do what you asked.. that is such a relief...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. windows .dll vs. linux .so - global static objects
    By pheres in forum C++ Programming
    Replies: 11
    Last Post: 11-23-2010, 12:29 PM
  2. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 03:44 AM
  3. linux and windows lookup host processes
    By Lynux-Penguin in forum Tech Board
    Replies: 0
    Last Post: 08-31-2003, 11:54 PM
  4. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  5. Linux and Windows Duel Boot
    By The15th in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-26-2002, 04:59 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21