Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can´t to compile by modules!

Status
Not open for further replies.

rick05

Programmer
Feb 23, 2001
15
MX

Hi guys, and thaks for answer my previous post, I have fixed thaks to matt!

now I have another trouble, I want to compile my program in modules, before I had my program in a file (all, my classes, and my main, etc) however now I want to cut it into modules:

in file.h my class definition
in file.cc my class implementation
*
*
and so all my classes

and in system.cc my main function

but I cant to link them!

I have compiled all object files fine without errors!, however when I tried to link I got some errors like this:

undefined test<int>::test function in file.cc

why???

I made a test with a classes without templates and it worked!

I hope U can help me again.

thx.

rick
 
if your not using a make file you need to specify all the files.


example with gcc

gcc system.cc files.cc (etc...)


Matt
 
try to link resulted object files togever to obtain the executable. Ion Filipski
1c.bmp


filipski@excite.com
 


well... I have tried it that U say

but I got the below error...

when I tried to compila object files, I made them without troubles..

however when I do

g++ -o system system.o container_class.o

I get the error, and I can´t to create the exe file (system in this case)

only a doubt... if I do it this whith a template class, is supose that it must works the same way if I do it with a class without template?

rick

 
I think no. Templates are compilled statically. You can't use them runtime. Ion Filipski
1c.bmp


filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top