LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-18-2005, 11:50 PM   #1
sal_paradise42
Member
 
Registered: Jul 2003
Location: Utah
Distribution: Gentoo FreeBSD 5.4
Posts: 150

Rep: Reputation: 16
g++ 4.0


Hello,

I am having some issues with the g++ 4.0 compiler on the Mac OS Tiger and FreeBSD 5.4, well I am not exactly sure if they are problems.
I am currently taking a c++ class, my code does not work when I try to compile two source files, into one executable file with a header:
Code:
g++ file1.cpp file2.cpp
but with the borland 5.x compiler in windows it does work, and really simple code like a `cout << "blah"` type stuff works fine with g++.
So is there something specific in the code that may not be working properly? or is it the compiler?
I can give more details if requested, but I am kind of a newbie with c++.
I hate to be limited to windows, as I use my Ibook for class mostly.
any help will be appreciated.
 
Old 10-19-2005, 12:31 AM   #2
Winno
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Fedora Core 3 / Mandrake 10.1 / Gentoo 2005.0
Posts: 100

Rep: Reputation: 15
It would help if you can show us the source files. Also, adding a -o <executable name>, eg g++ -o myprog source1.cpp source2.cpp will output a file called myprog.

Or it might be ANSI standard code your compiling, so add -ansi to the arguments.
 
Old 10-19-2005, 07:13 PM   #3
sal_paradise42
Member
 
Registered: Jul 2003
Location: Utah
Distribution: Gentoo FreeBSD 5.4
Posts: 150

Original Poster
Rep: Reputation: 16
actually it turns out to be my code, sorry to waste your time.
Thanks for the -ansi heads up though.
 
  


Reply



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



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:00 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration