C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 02-26-2002, 02:02 PM   #1
Registered User
 
Join Date: Feb 2002
Posts: 328
Question Compiling assembly code into project

I can't seem to reference functions in the assembled .obj file from my project.. How is this done?
I'm using Watcom C, and included the file in the project, still it will say that the function doesn't exist. Does the prototype have to look in a particular way?
I've prototyped it like this: void somefunc(void);
Any suggestions?

Best regards knutso
knutso is offline   Reply With Quote
Old 02-26-2002, 02:08 PM   #2
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,648
> I've prototyped it like this: void somefunc(void);
But when you try and call this, and the linker tells you it's unresolved, what is the actual symbol name.

Some compilers prefix the name with an underscore, so somefunc in your code would actually be _somefunc to the linker.

It's the linker version of the name which you want to be using for the name of the function in your asm file.

I'm assuming that the compiler and and assembler are matched - in that they produce a common .OBJ format.
Salem is offline   Reply With Quote
Old 02-26-2002, 03:24 PM   #3
Registered User
 
Join Date: Feb 2002
Posts: 328
assembler code

Hi, and thanks for the reply.
The assembler, compiler and linker are all part of the Watcom package, so they should match..
The functions are prefixed with an underscore too..
knutso is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
have some difficulty compiling a project Masterx C++ Programming 1 04-04-2009 07:49 AM
Problem with compiling code with option -O2 koushikyou C Programming 16 01-07-2009 06:03 AM
Linking an assembly routine into a GCC project huh C++ Programming 3 11-21-2002 03:14 PM
converting c/c++ code to assembly moonwalker A Brief History of Cprogramming.com 8 07-25-2002 02:15 PM


All times are GMT -6. The time now is 09:15 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22