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.
[01:01 am]
Oh_Man -- Heroes of the Storm literally died and was revived before we got next SC game. Wb Loveless, u cooking any UMS for us?
[11:35 pm]
LoveLess -- getting diablo 5 and wow 4 before starcraft ghost
[09:22 pm]
RIVE -- To be fair, I used to post custom emotes back when I still used the forums.
[12:54 pm]
l)ark_ssj9kevin -- RIVE
RIVE shouted: 💯
holy shit did you just use an emoji on SEN that feels illegal 🍆
[10:24 am]
Moose -- Heinermann
Heinermann shouted: new era of SC and it's just some shooter they're gonna cancel before 2030
StarCraft 2: Ghost 2, The Reghostening
[03:38 am]
Symmetry -- :wob:
[03:13 am]
Zoan -- :wob:
[03:01 am]
RIVE -- 💯
[02:40 am]
Heinermann -- new era of SC and it's just some shooter they're gonna cancel before 2030
[2026-9-12. : 2:39 pm]
Oh_Man -- who's ready for blizzcon? a new era of SC may well be beginning
Please log in to shout.


Members Online: RIVE, Oh_Man, dydwk474, lil-Inferno