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.
[10:13 pm]
Oh_Man -- No APM in chess. Computer just outthinks the human by seeing more moves ahead and more permutations
[10:12 pm]
Oh_Man -- U reckon? Kasparov waa defeated by computer decades ago
[05:47 pm]
NimoStar -- If its any consolation, the human brain would still mop the floor with this bot if it wasn't limited by the mechanical interface
[05:34 pm]
NimoStar -- Well. The bot didn't come up with any new strategy. It just has superhuman micro. Hard to beat that. I reckon even the simplest dedicated chess engines are unbeatable for humans now.
[02:13 pm]
Oh_Man -- all g
[10:54 am]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider did u watch the entire video? it's not one game. it's currently dominating the ladder at number 1 position. do ur research first!
Oops, caught me there, no I haven't. :( I was imagining how the game went. Sorry for that. Watching it now. brb
[10:52 am]
NudeRaider -- NimoStar
NimoStar shouted: They were not "Unprepared" that was their fifth loss in a row against the bot. The other replays are also available
that doesn't mean he was prepared. When humans come around with new strategies it often takes weeks until the pros figure out how to shut it down. Oh_Man that's certainly a way more convincing argument for micro being "too good to beat".
[09:43 am]
DiearAnother -- wirefram
[08:35 am]
NimoStar -- Well, pros showed that long ago... half of zerg pros just ling muta rush
[08:35 am]
NimoStar -- " its shown is that you can trade 1000's of apm to make up for lack of strategy"
Please log in to shout.


Members Online: O)FaRTy1billion[MM], Oh_Man