Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 12-29-2010, 11:38 PM   #1
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 (
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
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555
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
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.


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:35 AM.

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