Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Errors when running Modelsim code

Status
Not open for further replies.

tarkyss

Full Member level 6
Joined
Aug 1, 2005
Messages
345
Helped
26
Reputation
52
Reaction score
9
Trophy points
1,298
Location
China
Activity points
4,187
ld command gcc

I used the example
h**p://www.asic-world.com/verilog/pli2.html#Modelsim
but when i run
gcc -c -g -I$MODEL/include pli_full_example_modelsim.c
there are a warning
hello_vpi_modelsim.c: In function `registerHelloSystfs':
hello_vpi_modelsim.c:9: warning: assignment from incompatible pointer type
then i run
ld -shared -E -o pli_full_example.sl pli_full_example_modelsim.o
it is said ther are no -shared and -E parameter, I check my ld, my ld has not the two parameters
then i dont user -shared and -E, used ld -o only
but it display
vpi_printf and vpi_register_systf are not defined
even i excute
cat /user/modelsim6.1a/modeltech/include/vpi_user.h >> hello_vpi.c
it still display
vpi_printf and vpi_register_systf are not defined
why
i try my own code, running gcc, there is no warning, but when running ld it cannot work yet,
in my code srand and rand function is used
so it said srand is not defined
thanks
 

cfant

Full Member level 3
Joined
Apr 4, 2001
Messages
188
Helped
25
Reputation
50
Reaction score
6
Trophy points
1,298
Location
California, USA
Activity points
1,151
Re: about gcc and ld command

You will need to add modelsim libraries if you want to link executeble with ld. Also -shared is used to generate shared library and not an executable program.
 

ilamseeker

Member level 1
Joined
Apr 7, 2006
Messages
41
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,720
Re: about gcc and ld command

use the manual pages for the best help....i mean the man command...
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top