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.
[11:05 pm]
Ultraviolet -- :wob:
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[2024-5-18. : 3:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
Please log in to shout.


Members Online: lil-Inferno