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:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[07:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[2026-7-26. : 3:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[2026-7-26. : 3:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[2026-7-26. : 3:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[2026-7-26. : 3:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
[2026-7-23. : 6:40 am]
Oh_Man -- true
[2026-7-23. : 3:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
Please log in to shout.


Members Online: Roy