Staredit Network > Forums > Technology & Computers > Topic: Linker Error: file format not recognized...
Linker Error: file format not recognized...
Feb 2 2009, 1:39 am
By: Ahli  

Feb 2 2009, 1:39 am Ahli Post #1

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Short description what I have to do as an exercise:
3 classes:

>> Matrix
-has 2 virtual functions: "write" and "print"

>> SMatrix (sparse matrix) (inheritance from Matrix)
-Constructor creates a matrix in a CRS (compact row storage) format reading a matrix in the standard format out of a file
-has "write" and "print"

>> DMatrix (inheritance from Matrix)
-reads a matrix in CRS format out of a file and stores it as a standard matrix (matrix[][])
-has "write" and "print"


########################
In the end I have to write a program main(...) that declares 2 pointers onto variables of the type Matrix and allocates them dynamically as SMatrix and DMatrix and use both functions: write and print.
########################


file: Matrix.hpp
Collapse Box


file: SMatrix.hpp
Collapse Box


file: SMatrix.cpp
Collapse Box


file: DMatrix.hpp
Collapse Box


file: DMatrix.cpp
Collapse Box


file: main.cpp
Collapse Box


What I type into console:
Code
g++ main.cpp Matrix.hpp DMatrix.hpp SMatrix.hpp DMatrix.cpp SMatrix.cpp -o Uebung3.exe


What I get:
Code
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:Matrix.hpp: file format not recognized; treating as
linker script
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:Matrix.hpp:1: syntax error
collect2: ld returned 1 exit status


matrix format example:
Collapse Box



I hope somebody can help me.

Post has been edited 2 time(s), last time on Feb 2 2009, 11:25 am by Ahli.




Feb 2 2009, 2:49 am O)FaRTy1billion[MM] Post #2

👻 👾 👽 💪

What is hpp?



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Feb 2 2009, 9:10 am Ahli Post #3

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

hpp = header file

EDIT:

I found the mistake.
My mistake was that I included the header files in the console command.

now I used the following command and it created the needed .exe:
Code
g++ main.cpp DMatrix.cpp SMatrix.cpp -o Uebung3.exe


-> I only need to include all used *.cpp files.

Post has been edited 1 time(s), last time on Feb 2 2009, 10:30 am by Ahli.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[11:43 pm]
Moose -- you don't
[10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
Please log in to shout.


Members Online: Excalibur