LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-29-2010, 11:38 PM   #1
hikaru1505
LQ Newbie
 
Registered: Dec 2010
Posts: 1

Rep: Reputation: 0
The error compile C/C++ in linux (but it does compile on Win)


Dear all
I have a piece of code that is part of a larger project, and it compiles in Windows just fine (using SSH Secure Shell Client). When I try to compile it in linux, it doesn't work. I get "[duong@node0 3D]$ icc -o DEM DEMsim_3D.cpp -lm -O2

DEMsim_3D.cpp.text+0xdb11): undefined reference to `operator*(double, Vector3D)'
DEMsim_3D.cpp.text+0xdb2d): undefined reference to `Vector3D:perator+=(Vector3D)'
........ ''

In the universities linux environment (either CentOS or RedHat--going to command line from SSH Secure File Transfer Client), it compiles fine, but segment faults when the sort is trying to run (once again back to the overload operator of the Point and Vector class).

I have my source files for the Point nad Vector class here (http://www.mediafire.com/?lso6nijbco51o5g).
Anyone have any idea?

Thank you very much!

Last edited by GrapefruiTgirl; 12-30-2010 at 08:47 AM. Reason: removed email address.
 
Old 12-30-2010, 08:57 AM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 543Reputation: 543Reputation: 543Reputation: 543Reputation: 543Reputation: 543
Moved: This thread is more suitable in "Programming", and has been moved accordingly to help your question get the exposure it deserves.

Also please note that adding your email address to the end of your post (I have removed it), is not a good idea for at least two reasons:

1) it looks like you expect people to personally email you with a solution; LQ doesn't work like that.
2) opens you up to potential torrents of SPAM email to your inbox; not good!

Kind regards, and good luck with this.
 
Old 12-30-2010, 09:11 AM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Those are linker errors. You need to link the libraries/object files that contain those functions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to compile software for any other Linux box which is do not have compile? hocheetiong Linux - Newbie 4 03-06-2009 04:35 PM
compile and build linux from kernel in win xp pradeep2002gs Linux - Newbie 3 11-09-2008 11:36 AM
Compile madwifi, ... compile error , how can i do. ERBRMN Linux - Networking 3 03-08-2006 07:56 PM
compile c++ in linux to run win windows2k qwijibow Programming 2 09-23-2003 11:53 AM
linux c++ compile error Chaucer Programming 3 11-11-2002 04:55 PM


All times are GMT -5. The time now is 02:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration