Solution for undefined Sym when compiling multiple files

Hi, I'd like to suggest a solution for the common 'undefined sym' problem.
Combining all the source files into one file solves the problem quite effectively.
I'm not sure if this is due to gcc, or some name mangling scheme that's throwing
the avm2 off but in any case, when I compile multiple c++ files 'separately', ie
g++ (or gcc) A.c B.c C.c -O3 -DOSX -DRT_AS3 -swc -o library.swc
results in
1) undefined _main if main() is not in C.c (but in another file which is not last in the list),
and
2) calling ANY function in A.c or B.c from C.c results in an "undefined sym" runtime error.
When combining the files into one unit however, and then compiling that unit works fine:
on linux/darwin:
cat A.c B.c C.c > unit.c
g++ (or gcc) unit.c -O3 -DOSX -DRT_AS3 -swc -o library.swc
hope this helps someone.
J

Perhaps I didn't explain my question well enough. We already are using a dependency management system (based on jam - blows the doors off of make). However, some of our libraries that we build consist of many ( 100+ ) individual .cpp files, and there are many of these libraries in a dependency hierarchy. Invoking the compiler once per file seems to be a source of considerable overhead. I want to invoke the compiler only twice per library, no matter how many individual .o files need to be rebuilt - once to rebuild the out of date subset of .c files (one "-c" style invocation, no link step, generate object files only), and once to link the rebuilt .o files and the unchanged .o files into the target shared object.
However, the compiler will not accept multiple "-o" flags, forcing us to invoke it once per file if we want to specify an output name. I want an option (or a workaround) that will allow us to specify multiple source files, and the output name for each in one compiler invocation. One approach could be a flag that could be used repeatedly to specify source file name / object file name pairs on the command line. Another would be a flag that set a derivation rule by which the output object file name would be generated from the input source file name.
Repeatedly invoking the entire toolchain to compile one file of many, when the include dependency graphs, symbol tables, template instantations, etc. of each of those files are certain to overlap to a great degree, seems to me like a huge waste. Why must we reparse std::basic_string for each source file if we know the build environment is the same, just because we want to specify the output filename?

Similar Messages

  • Compiling multiple files?

    This is kind of a theory question.
    when you compile a file that has references to other files(all files are in the same package), isnt the compiler supposed to check that those other files have been compiled and if they are not, then isnt it supposed to compile them as well. For example;
    public class MainFrame {
    public MainFrame () {
    super ();
    // init ();
    //testUnits ();
    init2 ();
    private void init2 () {
    FDocument document = new FDocument ();
    FPage page = new FPage ();
    FFrame rectangle = new FFrame ();
    FParagraph header = new FParagraph ();
    FFrame pageFrame = new FFrame ();
    FFrame footer = new FFrame ();
    FFrame testRectangle = new FFrame ();
    FFrame childRectangle = new FFrame ();
    when I compile MainFrame, should it not also compile FDocument, FPage, FFrame etc as well?
    at present I get the errors cannot resolve symbol: class FDocument etc.
    As well, where I have a file FPrintObject which contains a reference to another file FPage such as
    public FPrintObject(FPage pg){
    shouldnt it compile FPage when I compile FPrintObject?
    I get the same cannot resolve symbol error, and they are definitely in the same package.
    any suggestions? Thanks alot in advance. OZ!!
    PS I have to reference that code snippet, it was from an excellent article in Javaworld autjhored by Jean-Pierre Dube "Printing in Java".

    Ok, thanks alot guys, looks like I was mistaken in my understanding of how the compiler worked, That pretty much cleared it up. It looks like the easiest way to do it is through and IDE(I' m using JCreator LE) by using the build batch function. If I wanted to do it through the Dos Prompt, How would I do it?
    At present I would normally do;
    c:Print>c:\j2sdk1.4.0-rc\bin\javac MainFrame.java
    as quoted above
    No, only the file(s) you specify on the javac command> is(are) compiled. If you want to compile multiple
    > files at a time, then you need to specify them all as
    > arguments to the javac command.
    >
    so what would be the entry in order to specify them all as arguments to the javac command?
    using the example above if I also wanted to compile FDocument, FPage, FFrame.
    with regard to classpath, I have it set to
    path=c:\windows;c:\windows;c:\windows\command\j2sdk1.4.0-rc\bin
    Thanks, you're help is great.

  • Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    I did copy it to my desktop, but it still won't let me open it.  I think the file on the disc might be corrupt or something like that though the cd itself checks out fine as far as viruses go.  I was able to verify the disc, but that's about it.  My husband tried it on his iMac and we have the same issue.  It's unzipping the folder, but won't let us open the folder on both the Mac Book Pro or the iMac by double clicking, going to file/open or right clicking.  It just keeps saying the same message as I posted above.  I think I'm just going to have the client put the pictures on either a memory card or a USB memory stick so she won't have to compress the files for zipping purposes.  It's been too frustrating trying to open this folder on this cd she gave me.  She said she created/zipped the cd on her Mac Book Pro but it sure won't open on mine.

  • Adobe Acrobat pro 9.4.6 crashes when opening multiple files simultaneously.

    We have Adobe Acrobat Pro 9 which has been updated to version 9.4.6. we had this problem when the 9.4.5 update was applied also. It is now crashing when we try to open multiple files simultaneously.
    Yesterday, I narrowed down the problem to 6 plugins:
    IA32
    ADBC
    eBook
    EScript
    HLS
    PPKLite
    SaveAsRTS
    However, we discovered that that Comments and markup tool bars weren't loading. So I did a repair install on it.
    Now those plugins from yesterday work and Acroform.api is causing it to crash when opening multiple files.
    I did try other suggestion that involved using Icacls/cacls on dll files to no avail.
    It is running on XP SP3 fully updated with plenty of RAM and HDD space.
    Is there a way to fix this without reinstalling?

    I am not sure what's causing this problem on your machine because everything's working fine for me.
    What is the version of Acroform.api on your machine now.
    Do a Repair after deleting this file and see if it works.
    Enable Windows MSI logging (http://support.microsoft.com/kb/314852) before you do a repair, upload that log to some file sharing server, and paste its link here.

  • Acrobat Pro 9.3 Crashes when opening multiple files

    Acrobat Pro 9.3 Crashes when opening multiple files. I have not seen any solutions in forums that solves this problem. I have just done the most recent update and it still crashes.

    Acrobat Pro 9.4.2 (CS5) is doing the same thing on my Windows XP SP3 with 3.5 GB of ram and 206 GB of my brand new 300 GB hard drive free.
    It starting doing this at the end of last year before my hard drive died.  Then after rebuilding the entire system on this new drive it worked fine, until I downloaded all the updates and now it is broken again.  Anytime I open more than one PDF, Acrobat crashes.  I send the error report every time.

  • Disappering cursor when placing multiple file in Indesign.

    When placing multiple file (jpeg, tiff's, pdf files,etc.) in a indesign document, my cursor disappears. If you can get to the desktop and click on it, it will come back.
    first started in Indesign CC 2014, Any fix for this?
    Thanks, Dennis

    Hi,
    This is an expected behavior, when you place an image in InDesign then it display the preview of the image however you this has no impact on the output unless the image placed is of low-resolution itself.
    In order to have good resolution of images, you may switch to View > Display Performance > High Quality.
    Thanks,
    Manish Sharma

  • Adobe Acrobat 9.5 crashes when OCR multiple files.

    Adobe Acrobat 9.5 crashes when OCR multiple files. A window appears Adobe Acrobat has stopped working." Then Windows closes the program.
    Log Name:      Application
    Source:        Application Error
    Date:          7/15/2013 9:08:55 AM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      ENV12W7.dot.state.nv.us
    Description:
    Faulting application name: Acrobat.exe, version: 9.5.5.316, time stamp: 0x518ac052
    Faulting module name: drs832.dll, version: 8.0.2.1088, time stamp: 0x47f2127d
    Exception code: 0xc0000005
    Fault offset: 0x0013c31f
    Faulting process id: 0x109c
    Faulting application start time: 0x01ce8174d93e1008
    Faulting application path: C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Acrobat.exe
    Faulting module path: C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\plug_ins\PaperCapture\drs832.dll
    Report Id: d8a8f897-ed68-11e2-bae0-d4ae52c31ca5

    Please do check the Performance of your computer at that point of time .
    As some time the usage also causes the issue that makes a software stopped working .
    In order to chek the system performance , check the Task Manager and go to Performance tab .
    If still the issue persists , try wih the following link :
    http://helpx.adobe.com/acrobat/kb/acrobat-could-access-recognition-service.html

  • Any solution for 4280 error when using Itunes to burn CDs?

    Any solution for 4280 error when using Itunes to burn CDs?

    http://support.apple.com/kb/TA38101?viewlocale=en_US

  • Error: code too large for try statement, when compiling a big java file.

    Hi,
    I have a big java file ( around 16000 lines). When compiling it, I got following error message:
    MyMain.java:15233: code too large for try statement
    } catch ( Throwable t ) {
    In MyMain.java, I just repeat following statements about 1000 times.
    try {
    if ( year >= 2002 ) {
    System.out.println( "year: Evaluation version is not valid" );
    } else {
    System.out.println( "year: Evaluation version is still valid" );
    } catch ( Throwable t ) {
    if ( year >= 2002 ) {
    System.out.println( "year: Evaluation version is not valid" );
    } else {
    System.out.println( "year: Evaluation version is still valid" );
    I tried 1.3 and 1.4 javac compiler, there was some error.
    How to make compiler to compile this code?
    Thanks,

    Hi,
    I have a big java file ( around 16000 lines). When
    compiling it, I got following error message:
    MyMain.java:15233: code too large for try statement
    } catch ( Throwable t ) {
    I tried 1.3 and 1.4 javac compiler, there was some
    error.
    How to make compiler to compile this code?
    You don't. Each method has an absolute limit on the number of byte codes. You have reached that limit. The limit is part of the specification and JVMs will refuse to run classes that exceed the limit. So even if you could compile it, it wouldn't run.
    It is quite common for code generators to generate large monolithic blocks of code. Presumably this is how you got to this spot. Modify the code generator to break it into smaller blocks.
    If you did it manually then you did it wrong. And you will have to manually break it into smaller blocks. (And re-examine your design since it is probably wrong.)

  • Hiding filenames when combining multiple files into a single .pdf

    I'm fairly new to this Acrobat X. I'm trying to assemble my portfolio to distribute to employers but I cannot seem to get rid/hide the filenames in the final pdf file. I was using the option to 'combine multiple files into a single pdf' because I was compiling images and documents to a single readable pdf file. I got all that done but once I open it, I'd see that each page would still contain the original file names rather than page numbers - which I prefer not to have employers see for the sake of tidiness (and I refuse to use the Adobe portfolio because it's not really efficient on space or design. I prefer a simple page-by-page pdf). So I was wondering if anyone can tell me how to hide my file names, change them into page numbers or getting rid of them all together so the 'Table of Contents' in the pdf preview mode would not show anything, I would really much appreciate it.
    -Ss

    Well, when the .pdf is in the final, deliverable form; I open it in Mac preview mode and the sidebar is always extended showing a 'table of contents' rather than having each document in the pdf file have a number designating a page name, it shows each individual filename the pdf is composed of. Not too sure about bookmark, though. Thanks for the reply!
    If you want, I can send the file to you.

  • Email notification to specific user when processing multiple files at a time

    Hi 
    I am new to SSIS and error mail notification ,can some please provide details for my urgent and prioritized task in my project.
    below is the requirement
    I have a package for multiple file processing using for each file enumerator .each file having same column definition but for different
    users and different name .
    i have some mandatory fields to form unique id on combination
    1.when files processing any data missed on mandatory fields it should alert users saying following line and fields are missing mandatory
    information 
    2.email notification should send to respective users based on file name.
    example :
    file1:bitunimous.xls 
    file 2.oxford.xls
    each file having following fields
    file 1:bitunimous.xls
    claim no: claimant: subclaim:
    1001 abc 0 
    1002 abc 1 
    1002 abe 0 
    1004 0
    here bitunimous.xls missed claimant value for 4th line then email needs to send to [email protected] as
    line no 4 missed claimant information for unique key generation like that.
    file 2.oxford.xls
    claim no: claimant: subclaim:
    2001 det 0 
    2002 pre 1 
    pqr 0 
    2004 frc
    here oxford.xls missed claimno value for 3rd line then email needs to send to [email protected] as
    line no 3 missed claimno information for unique key generation like that.
    can anybody please provide solution 
    Thanks .
    Ambed

    You need to have a package with below work flow
    1. ForEachLoop container with file enumerator to loop through files
     Have variable inside loop to get the filename during each iteration. Create another variable called emailaddress, set EvaluateAsExpression property to true and set expression as
    REPLACE(@[User::FileName],".xls","") + (DT_STR,20,1252) "@xyx.com"
    2. Add tasks for validating data. Capture details of error on a string variable @[User::Error]
    3. link a sent mail task to previous task and choose expression and constraint option. Set Constraint as On Completion and Expression as LEN(@Error) > 0
    Inside Sent mail task set expression for ToLine and MessageSource properties to map to variables @[User::EmailAddress] and @{User::Error] respectively to sent notifications
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • SystemManager.as : 'should never get here' when uploading multiple files

    I have a code for uploading multiple files. The code works so that when complete event from the first upload is received, the second upload is started. The code works fine on Flash Player 9, but now when I changed my compiler settings to require version 10, the program no longer works.
    Also this only seems to occur when I execute the code from the Flash Builder. I have compiled the code with ant requiring FP version 10. This swf is bundled inside a war and can executed without any problems. I actually set the ant compiler to require FP 10 some time ago already.
    I get error 2174, which is for trying to upload multiple files at the same time. Although, I don't understand why I get this, since the uploads should not be done simultaneously as I explained above.
    The interesting thing here is when I try to debug it. At some point when stepping in the code, I get the following error thrown. It's thrown by the code pasted at the end. Interesting is the else block that throws the error, the comment says 'should never get here'.
    A bug in the framework or in Flex Builder?
    Using IE 8 with FP 10.0.32.18 (on Win XP if that matters).
    Thanks.
    Error
         at mx.managers::SystemManager/updateLastActiveForm()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:5087]
         at mx.managers::SystemManager/activateForm()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2352]
         at mx.managers::SystemManager/activate()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2307]
         at mx.managers::FocusManager/creationCompleteHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\FocusManager.as:1592]
         at flash.events::EventDispatcher/dispatchEventFunction()
         at flash.events::EventDispatcher/dispatchEvent()
         at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
         at mx.core::UIComponent/set initialized()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
         at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
         at Function/http://adobe.com/AS3/2006/builtin::apply()
         at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
         at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]
         private function updateLastActiveForm():void
              // find "form" in the forms array and move that entry to
              // the end of the array.
              var n:int = forms.length;
              if (n < 2)
                 return;     // zero or one forms, no need to update
              var index:int = -1;
              for (var i:int = 0; i < n; i++)
                 if (areFormsEqual(form, forms[i]))
                      index = i;
                      break;
              if (index >= 0)
                 forms.splice(index, 1);
                 forms.push(form);
              else
                 throw new Error();     // should never get here

    Thanks for the reply Alex.
    In both cases the URL is http. The only difference is that in one case everything is on server inside a war running on Tomcat to which I make connection via browser. In the other case the server side stuff is running on local computer on Tomcat and the Flex code is not bundled inside the war.
    In both cases the URL is in form of http://... When running locally, the URL is http://localhost:8080/myAppName. I don't know how the network card driver translates this URL, but what you said might have something to do with it.

  • Errors in log when compiling .CHM files (RH10)

    Hello,
    For some of our projects, some writers are seeing the following errors when compiling HTML help.
    The errors refer to .htm files that do not belong to the project (and they never have). The .htm files are not listed in the root.fpj file, in the project folder, or in source control (Visual SourceSafe). Other writers can open the project and compile without errors, so it suggests that the writer encountering the error has some phantom files on their machine that the compiler is referencing.
    We are seeing this with multiple projects, so I thought it was time to ask if anyone else has seen it or knows what might be causing it. It does not seem to have any effect on the .CHM file...everything looks like it is working. But it makes me uncomfortable to publish files knowing there were errors when compiling them.
    Thanks,
    Amy

    Hi Amy
    As you state others have no issues, it would seem to be related to the setup on those writers' machines.
    I think I'd approach it like this. Since you are referencing source control, this would mean the real content exists in the source control server. So you should be safe in totally clearing out the Working Folders of the affected PCs. So start there. Delete all files from the working folders of one of the affected PCs. Then open one of the projects that was issuing the warnings (your image listed simple warnings, not errors). This action should cause only the needed files to be copied down from the server.
    Then compile and my guess is that the issue will have resolved itself.
    And last but not least, I'd also ensure I had a decent backup of the folders in question before I did anything.
    Cheers... Rick

  • Compiling Multiple Files using JDK1.3.1

    C:\jdk1.2.2\bin\javac -d C:\classes -classpath <some classpath> C:\release\*.java
    The above works fine in the CMD promt of WIN2K server.
    C:\jdk1.3.1\bin\javac -d C:\classes -classpath <some classpath> C:\release\*.java
    This doesn't work, same error type is thrown for multiple files: "cannot resolve symbol".
    I think the problem seems to be in the autocompile, i.e while compiling a java file, the javac compiles all the import files (if class files don't exist). This happens in JDK1.2.2, but not in JDK1.3.1
    Any pointers to solve this problem.
    Thankx

    If your class uses another class from a package which is not compiled already
    it will throw this error. To overcome this just include the path to all the packages
    that your class uses in your classpath.
    Fx,
    you want to compile xxx.java and yyy.java in c:\javatest\
    But to compile these above two files you also have to compile files
    in c:\javatest\test\files\aaa.java and c:\javatest\test\files\bbb.java
    then you should have c:\javatest\ in your classpath.
    hope this helps.
    cheers.Also you should have the follwing import statements in xxx.java and yyy.java
    import test.files.aaa;
    import test.files.bbb;
    aaa.java and bbb.java can be compiled from c:\javatest\test\files\
    but alternatively, if you don't have the files compiled...when you compile
    xxx.java or yyy.java they should be compiled automatically, provided you
    have included the proper import statements.
    All the best !

  • Acrobat 7 freezes when combining multiple files

    I'm running Acrobat 7 Standard, and whenever I attempt to combine multiple PDF files acrobat will freeze up completely. It can scan, and add pages to an open document with no trouble. It will freeze whether I choose Create PDF From Multiple Files within acrobat, or if I select multiple files in windows explorer, then right click and choose Combine in Acrobat...
    I have cleared temporary files, repaired the program, and completely reinstalled the program. Even after a fresh reinstallation, it will lock up when trying to combine multiple files. It does everything else just fine.
    I am running a HPCompaq dc5100 MT, with Windows XP Pro. I have 2GB ram, and a P4 3.2Ghz processor. I also have a database program called Laserfiche that I run, though this problem occurs whether I have Laserfiche open or not. I've already tried killing all acceptable processes (minus adobe's of course) and recreated the error. I've also tried this with the most recent update 7.1.0 and without: both yeild the same result. Any help would be greatly appreciated.

    Dear all,
    I think I have the same problem... or not ?!
    => When I try to open multiple files at the same time it opens only the 2 or 3 first ones then it freezes on the Spinning Beach Ball of Death !
    => Then it never completely finishes loading and freezes up Indesign.
    => I am unable to cancel the dialog box and have to use cmd+alt+esc to close the program
    => then, the files open directly on indesign when I open the program again (jus as if the files had been loaded and ready to go)
    I am working on MAC OS X (10.7.3)
    Anybody could help please ?? (sorry for my english... I'm a French native speaker) 

Maybe you are looking for

  • I am having a strange problems on the Data entry Forms

    A form that has been used since 2005 in an old version of HFM 3.51 was migrated to SYstem 11.1.2.1 in January of 2012 and has been working since then. Suddenly we start having some strange problems. Our response time has been very slow and I am wonde

  • Is (4770 3.5 i7 qouad core 8 mb cach) good enough for premier and after effect?

    Hi guys, am buying the new imac 27" with its maximum features: 32 GB, 1 TB ssd, NVidia gtx 780 with 4GB, but I am worried about the cpu (4770 3.5 i7 qouad core 8 mb cach) is it good enough for premier and after effect?

  • Apps crash on Lion

    Hi I can's start the following apps an my MacBoook Pro (7.1) running OS X Lion 10.7.2 Google Earth (crash log here ) TeamViewer (crash log here ) Rulers (crash log here ) I always get the EXC_BAD_ACCESS (SIGBUS) error. I did run "memtest" but got no

  • Order ICP members

    Hi All, Is there a possibility to have an ICP List by numeric or alphabetical order like by entities? Within the metadata file I can bring the entities in an alphabetical order and load this with replace. But this does not impact the order of the ICP

  • Other wireless networks cause failure?

    Has anyone encountered an issue where another wireless network in the area has induced your Extreme to fail to obtain anything but a 169.x.x.x address? I was thinking there was something wrong with our Airport; I even took it to the Apple store where